s2maps-gpu
Version:
S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.
63 lines (62 loc) • 2.56 kB
TypeScript
import type { MValue, VectorCoordinates, VectorGeometryType, VectorMultiPoint, VectorPoint } from 'gis-tools/index.js';
import type { Path } from './lineTools.js';
/**
* Flatten all geometry types to points
* @param geometry - vector geometry
* @param type - geometry type
* @returns vector points
*/
export declare function flattenGeometryToPoints<M extends MValue>(geometry: VectorCoordinates<M>, type: VectorGeometryType): VectorMultiPoint<M>;
/**
* Get the center points of the geometry
* @param geometry - vector geometry
* @param type - geometry type
* @returns vector points at the center of the geometry
*/
export declare function getCenterPoints<M extends MValue>(geometry: VectorCoordinates<M>, type: VectorGeometryType): VectorMultiPoint;
/**
* Get the spaced points of the geometry
* @param geometry - vector geometry
* @param type - geometry type
* @param spacing - distance between points
* @param extent - extent is the tile "pixel" size
* @returns vector points spaced along the line
*/
export declare function getSpacedPoints<M extends MValue>(geometry: VectorCoordinates, type: VectorGeometryType, spacing: number, extent: number): VectorMultiPoint;
/** Collection of Points that are spaced given guidlines. Used for glyph rendering */
export interface SpacedPoints {
point: VectorPoint;
distance: number;
pathLeft: Path;
pathRight: Path;
}
/**
* Find center points of the geometry
* @param geometry - vector geometry
* @param type - geometry type
* @param extent - extent is the tile "pixel" size
* @returns vector points at the centers of the geometry(s)
*/
export declare function findCenterPoints<M extends MValue>(geometry: VectorCoordinates<M>, type: VectorGeometryType, extent: number): SpacedPoints[];
/**
* Find points along the line at a given distance
* @param geometry - vector geometry
* @param type - geometry type
* @param spacing - distance between points
* @param extent - extent is the tile "pixel" size
* @returns vector points spaced along the line
*/
export declare function findSpacedPoints(geometry: VectorCoordinates, type: VectorGeometryType, spacing: number, extent: number): SpacedPoints[];
/**
* Duplicate a point
* @param point - the point to duplicate
* @returns the duplicated point
*/
export declare function duplicatePoint(point: VectorPoint): VectorPoint;
/**
* Get the angle between 2 points
* @param a - first point
* @param b - second point
* @returns the angle
*/
export declare function pointAngle(a: VectorPoint, b?: VectorPoint): number | undefined;