gis-tools-ts
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
62 lines • 2.81 kB
TypeScript
import type { BBox, MValue, Properties, RingIntersectionLookup, VectorLineString, VectorMultiPolygon, VectorPoint, VectorPolygon } from '../../../index.js';
/** Reconstructing a poly line that interacts with intersections */
export declare class PolyPath<D extends MValue = Properties> {
id: number;
outer?: VectorLineString<D>;
oldOuters: BBox[];
holes: VectorLineString<D>[];
polysConsumed: Set<number>;
bbox: BBox;
constructor(ring: VectorLineString<D>, polysConsumed: Set<number>, outer: boolean, bbox?: BBox);
getPath(): VectorPolygon | undefined;
}
/** The next poly chunk */
export interface NextRingChunk<D extends MValue = Properties> {
chunk: RingChunk<D>;
intPoint: VectorPoint<D>;
}
/** A path/piece/chunk from a polygon */
export declare class RingChunk<D extends MValue = Properties> {
polyIndex: number;
ringIndex: number;
bbox: BBox;
mid: VectorLineString<D>;
from: VectorPoint<D>;
to: VectorPoint<D>;
fromAngle: number;
toAngle: number;
visted: boolean;
next?: NextRingChunk<D>;
constructor(polyIndex: number, ringIndex: number, bbox: BBox, mid: VectorLineString<D>, // Always starts with either the beginning of the poly ring OR an intersection point.
from: VectorPoint<D>, to: VectorPoint<D>, fromAngle: number, toAngle: number);
equalChunk(other: RingChunk<D>): boolean;
}
/** Intersection Point */
export interface IntersectionPoint<D extends MValue = Properties> {
point: VectorPoint<D>;
from: RingChunk<D>[];
to: RingChunk<D>[];
}
/** Intersection Lookup for chunks */
export declare class InterPointLookup<D extends MValue = Properties> {
lookup: {
[x: number]: {
[y: number]: IntersectionPoint<D>;
};
};
get(point: VectorPoint<D>): IntersectionPoint<D>;
linkInts(polyIndex: number, ringIndex: number, from: VectorPoint<D>, to: VectorPoint<D>, mid: VectorLineString<D>, fromAngle?: number, toAngle?: number): RingChunk<D>;
}
/**
* Build the PolyPaths and RingChunks
* @param vectorPolygons - the collection of polygons
* @param ringIntersectLookup - the ring intersection lookup for all rings in the multipolygon collection
* @returns - the PolyPaths, their lookups, and RingChunks
*/
export declare function buildPathsAndChunks<D extends MValue = Properties>(vectorPolygons: VectorMultiPolygon<D>, ringIntersectLookup: RingIntersectionLookup<D>): [PolyPath<D>[], Map<number, PolyPath<D>>, RingChunk<D>[], InterPointLookup<D>, BBox[]];
/**
* Given an of intersection, find the best way to connect the from->to chunks
* @param intersection - the intersection to analyze
*/
export declare function mergeIntersectionPairs<D extends MValue = Properties>(intersection: IntersectionPoint<D>): void;
//# sourceMappingURL=pathBuilder.d.ts.map