UNPKG

s2maps-gpu

Version:

S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.

34 lines (33 loc) 1.67 kB
import { VectorGeometry, VectorLineString } from '../index.js'; import type { MValue, Properties } from '../../index.js'; /** * 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;