s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
65 lines • 2.9 kB
TypeScript
import type { Header } from './pmtiles';
import type { Face, Metadata } from 's2-tilejson';
import type { ReaderInputs } from '..';
/** A description of where a tile can be found in the archive. Both offset and length are in bytes */
export interface S2PMTilesTileEntry {
offset: number;
length: number;
}
/** The File reader is to be used by bun/node/deno on the local filesystem. */
export declare class S2PMTilesReader {
#private;
readonly path: string | ReaderInputs;
/**
* Given an input path, read in the header and root directory
* @param path - the location of the PMTiles data
* @param rangeRequests - FetchReader specific; enable range requests or use urlParam "bytes"
* @param maxSize - the max size of the cache before dumping old data. Defaults to 20.
*/
constructor(path: string | ReaderInputs, rangeRequests?: boolean, maxSize?: number);
/**
* Get the header of the archive
* @returns - the header of the archive
*/
getHeader(): Promise<Header>;
/**
* Get the metadata of the archive
* @returns - the metadata of the archive
*/
getMetadata(): Promise<Metadata>;
/**
* Check if an S2 tile exists in the archive
* @param face - the Open S2 projection face
* @param zoom - the zoom level of the tile
* @param x - the x coordinate of the tile
* @param y - the y coordinate of the tile
* @returns - true if the tile exists in the archive
*/
hasTileS2(face: Face, zoom: number, x: number, y: number): Promise<boolean>;
/**
* Get the bytes of the tile at the given (face, zoom, x, y) coordinates
* @param face - the Open S2 projection face
* @param zoom - the zoom level of the tile
* @param x - the x coordinate of the tile
* @param y - the y coordinate of the tile
* @returns - the bytes of the tile at the given (face, zoom, x, y) coordinates, or undefined if the tile does not exist in the archive.
*/
getTileS2(face: Face, zoom: number, x: number, y: number): Promise<Uint8Array | undefined>;
/**
* Check if a tile exists in the archive
* @param zoom - the zoom level of the tile
* @param x - the x coordinate of the tile
* @param y - the y coordinate of the tile
* @returns - true if the tile exists in the archive
*/
hasTile(zoom: number, x: number, y: number): Promise<boolean>;
/**
* Get the bytes of the tile at the given (zoom, x, y) coordinates
* @param zoom - the zoom level of the tile
* @param x - the x coordinate of the tile
* @param y - the y coordinate of the tile
* @returns - the bytes of the tile at the given (z, x, y) coordinates, or undefined if the tile does not exist in the archive.
*/
getTile(zoom: number, x: number, y: number): Promise<Uint8Array | undefined>;
}
//# sourceMappingURL=reader.d.ts.map