UNPKG

gis-tools-ts

Version:

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

24 lines 1.28 kB
import type { Face, Feature, Geometry, MValue, Properties, S2Feature, VectorFeature, VectorGeometry } from '../../index.js'; /** * Convet a GeoJSON Feature to an S2Feature * @param data - GeoJSON Feature * @param buildBBox - optional - build a bbox for the feature if desired * @returns - S2Feature */ export declare function toS2<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(data: Feature<M, D, P, Geometry<D>> | VectorFeature<M, D, P, VectorGeometry<D>>, buildBBox?: boolean): S2Feature<M, D, P, VectorGeometry<D>>[]; /** The resultant geometry after conversion */ export interface ConvertedGeometry<M extends MValue = Properties> { /** The vector geometry that was converted */ geometry: VectorGeometry<M>; /** The face of the vector geometry that was converted */ face: Face; } /** A list of converted geometries */ export type ConvertedGeometryList<M extends MValue = Properties> = ConvertedGeometry<M>[]; /** * Underlying conversion mechanic to move GeoJSON Geometry to S2Geometry * @param geometry - GeoJSON Geometry * @returns - S2Geometry */ export declare function vectorGeoToS2<M extends MValue = Properties>(geometry: VectorGeometry<M>): ConvertedGeometryList<M>; //# sourceMappingURL=s2.d.ts.map