import type { Position } from "geojson"; /** Maximum vertices per geometry feature. A server constant, not a caller parameter. */ export declare const VERTEX_CAP = 1000; /** Anchors bound the worst case: no segment scan spans more than ~n / anchors vertices. */ export declare const anchorCount: (cap: number) => number; /** Rounds to 5 decimal places (about 1.1 m). */ export declare const roundCoord: (value: number) => number; export declare const roundPosition: (p: Position) => Position; /** The furthest rounding moves a position: half the 5th decimal on both axes (about 0.79 m). */ export declare const ROUNDING_ERROR_M: number; /** * Incremental priority-driven Douglas-Peucker over one path (a line or a closed ring). * `growTo` can be called again with a larger target, which the polygon fallback uses. * The `fixed` vertices are always kept, as anchors. */ export declare class PathSimplifier { private readonly coords; private readonly xs; private readonly ys; private readonly keep; private readonly heap; private kept; private scanned; constructor(coords: Position[], cap?: number, fixed?: Iterable); get points(): number; /** Vertices scanned for their error so far: the algorithm's work, independent of the machine. */ get work(): number; get complete(): boolean; /** Largest perpendicular distance, in metres, of any dropped vertex from the kept line. */ get maxErrorM(): number; growTo(target: number): void; /** The kept vertices' indices in the input, ascending. */ indices(): number[]; result(): Position[]; private addSegment; } /** Local equirectangular projection to metres, centred on the mean latitude. */ export declare function project(coords: Position[]): [Float64Array, Float64Array]; export interface SimplifiedPaths { paths: Position[][]; /** Present only when the input exceeded the cap. */ simplification?: { original_points: number; points: number; max_error_m: number; }; /** With `simplification`: each path's kept vertices, as indices into the input path. */ indices?: number[][]; } /** * Caps the total vertex count of a feature's paths (one line, or the rings of a * polygon) at `cap`, sharing the budget between paths by size. Below the cap the * paths are only rounded. For polygons, a simplified result whose rings cross is * rejected and simplified less, up to the original rings. `fixed` holds, per path, * the indices of vertices that are always kept. */ export declare function capPaths(paths: Position[][], options: { rings: boolean; cap?: number; fixed?: number[][]; }): SimplifiedPaths; /** * True when no two edges of the given closed rings touch or cross, apart from * neighbouring edges of the same ring. Edges are bucketed in a uniform grid of * about one edge per cell, and only edges sharing a cell are compared, so the * typical cost is linear. */ export declare function ringsAreValid(rings: Position[][]): boolean; //# sourceMappingURL=simplify.d.ts.map