s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
49 lines • 1.75 kB
TypeScript
import type { Face, Metadata } from 's2-tilejson';
export * from './pmtiles';
/** The defacto interface for all writers. */
export interface Writer {
write(data: Uint8Array, offset: number): Promise<void>;
append(data: Uint8Array): Promise<void>;
appendSync(data: Uint8Array): void;
appendString(string: string): Promise<void>;
appendStringSync(string: string): void;
}
/** A base interface for all tile stores. */
export interface TileWriter {
writeTileWM(zoom: number, x: number, y: number, data: Uint8Array): Promise<void>;
writeTileS2(face: Face, zoom: number, x: number, y: number, data: Uint8Array): Promise<void>;
commit(metadata: Metadata): Promise<void>;
}
/** Buffer writer is used on smaller datasets that are easy to write in memory. Faster then the Filesystem */
export declare class BufferWriter implements Writer {
#private;
/**
* Append data to the buffer
* @param data - the data to append
*/
append(data: Uint8Array): Promise<void>;
/**
* Append string to the buffer
* @param string - the string to append
*/
appendString(string: string): Promise<void>;
/**
* Append data to the buffer synchronously
* @param data - the data to append
*/
appendSync(data: Uint8Array): void;
/**
* Append string to the buffer synchronously
* @param string - the string to append
*/
appendStringSync(string: string): void;
/**
* Write data to the buffer
* @param data - the data to write
* @param offset - where in the buffer to start
*/
write(data: Uint8Array, offset: number): Promise<void>;
/** @returns - the buffer */
commit(): Uint8Array;
}
//# sourceMappingURL=index.d.ts.map