s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
39 lines • 1.71 kB
TypeScript
import type { Face, Feature, 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(data: Feature | VectorFeature, tolerance?: number, maxzoom?: number, buildBBox?: boolean): S2Feature[];
/**
* 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(data: Feature, buildBBox?: boolean): VectorFeature;
/** The resultant geometry after conversion */
export interface ConvertedGeometry {
/** The vector geometry that was converted */
geometry: VectorGeometry;
/** The face of the vector geometry that was converted */
face: Face;
}
/** A list of converted geometries */
export type ConvertedGeometryList = ConvertedGeometry[];
/**
* 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(feature: VectorFeature, 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(feature: VectorFeature): void;
//# sourceMappingURL=convert.d.ts.map