s2maps-gpu
Version:
S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.
47 lines (46 loc) • 2.36 kB
TypeScript
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>>[];
/**
* 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
*/
export declare function toUnitScale<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(feature: VectorFeature<M, D, P>): 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;
/**
* Convert a longitude to a 0->1 coordinate
* @param x - longitude
* @returns a 0->1 coordinate
*/
export declare function projectX(x: number): number;
/**
* Convert a latitude to a 0->1 coordinate
* @param y - latitude
* @returns a 0->1 coordinate
*/
export declare function projectY(y: number): number;