UNPKG

gis-tools-ts

Version:

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

34 lines 1.69 kB
import { VectorGeometry, VectorLineString } from '..'; import type { MValue, Properties } 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<M extends MValue = Properties>(geometry: VectorGeometry<M>, 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<M extends MValue = Properties>(coords: VectorLineString<M>, first: number, last: number, sqTolerance: number): void; /** * Simplifies the vector geometry based on zoom level and tolerance. * If the geometry is simplified past it being valid, set the coordinates to an empty array. * @param geometry - input vector geometry * @param tolerance - simplification tolerance * @param zoom - curent zoom * @param maxzoom - max zoom level */ export declare function simplify<M extends MValue = Properties>(geometry: VectorGeometry<M>, 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<M extends MValue = Properties>(ring: VectorLineString<M>, clockwise: boolean): void; //# sourceMappingURL=simplify.d.ts.map