gis-tools-ts
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
39 lines • 2.36 kB
TypeScript
import type { Face, Feature, Geometry, MValue, Properties, S2Feature, VectorFeature, VectorGeometry } from '..';
/**
* Convet a GeoJSON Feature to an S2Feature
* @param data - GeoJSON Feature
* @param tolerance - optional tolerance
* @param maxzoom - optional maxzoom
* @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>>, tolerance?: number, maxzoom?: number, buildBBox?: boolean): S2Feature<M, D, P, VectorGeometry<D>>[];
/**
* Convert a GeoJSON Feature to a GeoJSON Vector Feature
* @param data - GeoJSON Feature
* @param buildBBox - optional - build a bbox for the feature if desired
* @returns - GeoJson Vector Feature
*/
export declare function toVector<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties, G extends Geometry<D> = Geometry<D>>(data: Feature<M, D, P, G>, buildBBox?: boolean): VectorFeature<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>[];
/**
* Reproject GeoJSON geometry coordinates from lon-lat to a 0->1 coordinate system in place
* @param feature - input GeoJSON
* @param tolerance - if provided, geometry will be prepared for simplification by this tolerance
* @param maxzoom - if provided,
*/
export declare function toUnitScale<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(feature: VectorFeature<M, D, P>, tolerance?: number, maxzoom?: number): void;
/**
* Reproject GeoJSON geometry coordinates from 0->1 coordinate system to lon-lat in place
* @param feature - input GeoJSON
*/
export declare function toLL<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(feature: VectorFeature<M, D, P>): void;
//# sourceMappingURL=convert.d.ts.map