/** * XYZ tile coordinate utilities. * * Provides conversions between geographic coordinates (lon/lat) and * tile pixel coordinates for XYZ tiled map systems. Supports various * tile sizes and zoom levels. * * @module */ import { pointToTileFraction } from "@mapbox/tilebelt"; import type { GeoBbox2D, LonLat, Tile, TilePxBbox, XY } from "./types.ts"; export { pointToTileFraction }; /** * Get the geographic bounding box of a tile. * Returns [west, south, east, north]. */ export declare function tileToBbox(tile: Tile): GeoBbox2D; /** * Convert a bounding box from geographic coordinates to tile pixel coordinates. */ export declare function bboxToTilePx(bbox: GeoBbox2D, tile: Tile, tileSize?: number): TilePxBbox; /** * Convert a geographic coordinate to tile pixel coordinates. * Returns [x, y] in pixels relative to the top-left of the tile. */ export declare function llToTilePx(ll: LonLat, tile: Tile, tileSize?: number): XY; /** * Convert lon/lat bounds to Web Mercator tile range for a zoom. */ export declare function bboxToTileRange(bbox: GeoBbox2D, zoom: number): { minX: number; minY: number; maxX: number; maxY: number; count: number; }; /** * Convert tile pixel coordinates to geographic coordinates. */ export declare function tilePxToLonLat(px: XY, tile: Tile, tileSize?: number): LonLat; /** * Clamp a pixel coordinate to the tile bounds and round to the nearest integer. Useful for converting a floating point pixel * coordinate to a the exact tile pixel it is contained by. */ export declare function clampAndRoundPx(px: XY, tileSizeOrBbox: number | GeoBbox2D): XY; //# sourceMappingURL=tile.d.ts.map