s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
32 lines • 1.41 kB
TypeScript
import { VectorGeometry, VectorLineString } from '..';
/**
* Builds squared distances for the vector geometry using the Douglas-Peucker algorithm.
* @param geometry - input vector geometry
* @param tolerance - simplification tolerance
* @param maxzoom - max zoom level to simplify
*/
export declare function buildSqDists(geometry: VectorGeometry, tolerance: number, maxzoom?: number): void;
/**
* calculate simplification of line vector data using
* optimized Douglas-Peucker algorithm
* @param coords - input coordinates
* @param first - first point index
* @param last - last points index
* @param sqTolerance - simplification tolerance (higher means simpler)
*/
export declare function buildSqDist(coords: VectorLineString, first: number, last: number, sqTolerance: number): void;
/**
* Simplifies the vector geometry based on zoom level and tolerance.
* @param geometry - input vector geometry
* @param tolerance - simplification tolerance
* @param zoom - curent zoom
* @param maxzoom - max zoom level
*/
export declare function simplify(geometry: VectorGeometry, tolerance: number, zoom: number, maxzoom?: number): void;
/**
* In place adjust the ring if necessary
* @param ring - the ring to rewind
* @param clockwise - whether the ring needs to be clockwise
*/
export declare function rewind(ring: VectorLineString, clockwise: boolean): void;
//# sourceMappingURL=simplify.d.ts.map