import type { BBox, Face, JSONCollection, MValue, Properties, S2CellId, VectorFeatures, VectorGeometry, VectorLineString, VectorMultiLineString, VectorMultiPolygon, VectorPoint, VectorPolygon } from './index.js'; /** Tile metadata */ export type TileID = WMTileID | S2TileID; /** WM Tile's metadata */ export interface WMTileID { zoom: number; x: number; y: number; } /** S2 Tile's metadata */ export interface S2TileID { face: Face; zoom: number; x: number; y: number; } /** * Convert a tileID to an S2CellId * * @param tileID - the tileID to convert * @returns the S2CellId */ export declare function tileToID(tileID: TileID): S2CellId; /** * Convert an S2CellId to a tileID * * @param id - the S2CellId * @param isWM - whether the tileID is an WM tile or an S2 tile * @returns the appropriate tileID */ export declare function tileFromID(id: S2CellId, isWM: boolean): TileID; /** * Convert a tileID to a BBox * * @param tileID - the tileID * @param tmsStyle - whether the tile is TMS style. Only applicable to WM tiles. Inverts the Y axis * @returns the BBox of the tile */ export declare function tileToBBox(tileID: TileID, tmsStyle?: boolean): BBox; /** * Convert a tileID to a center lon-lat * @param tileID - the tileID * @param tmsStyle - whether the tile is TMS style. Only applicable to WM tiles. Inverts the Y axis * @returns the center lon-lat of the tile */ export declare function tileToCenterLonLat(tileID: TileID, tmsStyle?: boolean): VectorPoint; /** * Get the children tiles of a tile * * @param tileID - the tile * @returns the children */ export declare function tileChildren(tileID: TileID): [TileID, TileID, TileID, TileID]; /** * Get the parent tile * * @param tileID - the tile * @returns the parent tile */ export declare function tileParent(tileID: TileID): TileID; /** * Get the neighbors of a tile * * @param tileID - the tile * @returns the neighbors */ export declare function tileNeighbors(tileID: TileID): TileID[]; /** * Get the tile from a Lon-Lat WGS84 coordinate * * @param point - the point * @param zoom - the zoom level to find the tile in * @returns the tile at the zoom that contains the point */ export declare function wmTileFromPoint(point: VectorPoint, zoom: number): WMTileID; /** * Get the S2 tile from a point that is in S2's S-T coordinate space * * @param point - the point * @param face - the face of the S2 Cube the geometry is in * @param zoom - the zoom level to find the tile in * @returns the tile at the zoom that contains the point */ export declare function s2TileFromPoint(point: VectorPoint, face: Face, zoom: number): S2TileID; /** * Get the tiles from Lon-Lat WGS84 coordinates * * @param point - the point * @param zoom - the zoom level to find the tile in * @returns the tile at the zoom that contains the point */ export declare function wmTileFromMultiPoint(point: VectorPoint[], zoom: number): WMTileID[]; /** * Get the S2 tiles from a collection of points that are in S2's S-T coordinate space * * @param points - the source points to generate tiles from * @param face - the face of the S2 Cube the geometry is in * @param zoom - the zoom level to find the tile in * @returns the tile at the zoom that contains the point */ export declare function s2TileFromMultiPoint(points: VectorPoint[], face: Face, zoom: number): S2TileID[]; /** * Get the tiles that cover a linestring from Lon-Lat WGS84 coordinates * * @param points - the linestring * @param zoom - the zoom level * @returns the tiles that contain the linestring at the zoom */ export declare function wmTilesFromLineString(points: VectorLineString, zoom: number): WMTileID[]; /** * Get the S2 tiles that cover a linestring from S2's S-T coordinate space * * @param points - the linestring * @param face - the face of the S2 Cube the geometry is in * @param zoom - the zoom level * @returns the tiles that contain the linestring at the zoom */ export declare function s2TilesFromLineString(points: VectorLineString, face: Face, zoom: number): S2TileID[]; /** * Get the tiles that cover a multilinestring from Lon-Lat WGS84 coordinates * * @param lines - the multilinestring * @param zoom - the zoom level * @returns the tiles that contain the multilinestring at the zoom */ export declare function wmTilesFromMultiLineString(lines: VectorMultiLineString, zoom: number): WMTileID[]; /** * Get the S2 tiles that cover a multilinestring from S2's S-T coordinate space * * @param lines - the multilinestring * @param face - the face of the S2 Cube the geometry is in * @param zoom - the zoom level * @returns the tiles that contain the multilinestring at the zoom */ export declare function s2TilesFromMultiLineString(lines: VectorMultiLineString, face: Face, zoom: number): S2TileID[]; /** * Get the tiles that cover a polygon from Lon-Lat WGS84 coordinates * * @param poly - the polygon * @param zoom - the zoom level * @returns the tiles that cover the polygon */ export declare function wmTilesFromPolygon(poly: VectorPolygon, zoom: number): WMTileID[]; /** * Get the S2 tiles that cover a polygon from S2's S-T coordinate space * * @param poly - the polygon * @param face - the face of the S2 Cube the geometry is in * @param zoom - the zoom level * @returns the tiles that cover the polygon */ export declare function s2TilesFromPolygon(poly: VectorPolygon, face: Face, zoom: number): S2TileID[]; /** * Get the tiles that cover a multipolygon from Lon-Lat WGS84 coordinates * * @param polys - the multipolygon * @param zoom - the zoom level * @returns the tiles that cover the multipolygon */ export declare function wmTilesFromMultiPolygon(polys: VectorMultiPolygon, zoom: number): WMTileID[]; /** * Get the S2 tiles that cover a multipolygon from S2's S-T coordinate space * * @param polys - the multipolygon * @param face - the face of the S2 Cube the geometry is in * @param zoom - the zoom level * @returns the tiles that cover the multipolygon */ export declare function s2TilesFromMultiPolygon(polys: VectorMultiPolygon, face: Face, zoom: number): S2TileID[]; /** * Convert a vector geometry to the WM tiles that cover it * * @param geom - the vector geometry * @param zoom - the zoom level * @returns the tiles that cover the vector geometry */ export declare function wmTileFromVectorGeometry(geom: VectorGeometry, zoom: number): WMTileID[]; /** * Convert an S2 vector geometry to the S2 tiles that cover it * * @param geom - the vector geometry * @param face - the face of the S2 Cube the geometry is in * @param zoom - the zoom level * @returns the tiles that cover the vector geometry */ export declare function s2TileFromVectorGeometry(geom: VectorGeometry, face: Face, zoom: number): WMTileID[]; /** * Convert a vector feature to the WM tiles that cover it * * @param feature - the vector feature * @param zoom - the zoom level * @returns the tiles that cover the vector feature */ export declare function wmTileFromVectorFeature, D extends MValue = Properties, P extends Properties = Properties>(feature: VectorFeatures, zoom: number): WMTileID[]; /** * Convert an S2 vector feature to the S2 tiles that cover it * * @param feature - the vector feature * @param zoom - the zoom level * @returns the tiles that cover the vector feature */ export declare function s2TileFromVectorFeature, D extends MValue = Properties, P extends Properties = Properties>(feature: VectorFeatures, zoom: number): WMTileID[]; /** * Convert input GeoJSON or S2JSON data into a list of WM Tiles if covers. * If you are unsure about the input data or you have a FeatureCollection/S2FeatureCollection, * this is your best bet. * * @param json - the vector data * @param zoom - the zoom level * @returns the tiles that cover the vector feature */ export declare function wmTileFromJSON, D extends MValue = Properties, P extends Properties = Properties>(json: JSONCollection, zoom: number): WMTileID[]; /** * Convert input GeoJSON or S2JSON data into a list of S2 Tiles if covers. * If you are unsure about the input data or you have a FeatureCollection/S2FeatureCollection, * this is your best bet. * * @param json - the vector data * @param zoom - the zoom level * @returns the tiles that cover the vector feature */ export declare function s2TileFromJSON, D extends MValue = Properties, P extends Properties = Properties>(json: JSONCollection, zoom: number): WMTileID[]; /** * Given a collection of tiles at various zoom levels, merge them into a single collection at a * higher zoom level when possible * * @param tiles - list of tiles * @returns a merged/simplified list of tiles where a full collection of children are simplified into their parent */ export declare function mergeTiles(tiles: TileID[]): TileID[]; //# sourceMappingURL=tile.d.ts.map