UNPKG

gis-tools-ts

Version:

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

49 lines 2.86 kB
import type { MValue, Properties, VectorFeature, VectorGeometry, VectorMultiPointGeometry, VectorPoint } from '../../index.js'; /** * Check if two XYZ Points are equal * @param a - The first XYZ Point * @param b - The second XYZ Point * @returns - True if the two XYZ Points are equal */ export declare function equalPoints(a?: VectorPoint, b?: VectorPoint): boolean; /** * Find the average of a collection of Vector points * @param vectorPoints - collection of Vector points, whether from a VectorFeature, geometry, or raw coordinates * @returns - the average of the vector points */ export declare function averageOfPoints<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(vectorPoints: VectorPoint<D>[] | VectorMultiPointGeometry<D> | VectorFeature<M, D, P, VectorMultiPointGeometry<D>>): VectorPoint<D>; /** * Find the center of a collection of Vector points * @param vectorPoints - collection of Vector points, whether from a VectorFeature, geometry, or raw coordinates * @returns - the center of the vector points */ export declare function centerOfPoints<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(vectorPoints: VectorPoint<D>[] | VectorMultiPointGeometry<D> | VectorFeature<M, D, P, VectorMultiPointGeometry<D>>): VectorPoint<D>; /** * Given an input vector feature, create a collection of points * @param data - vector feature with various geometry types * @returns - all features as a collection of points */ export declare function toPoints<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(data: VectorFeature<M, D, P, VectorGeometry<D>>): VectorMultiPointGeometry<D>; /** * Get the bearing in degrees between two points * @param start - starting point * @param end - ending point * @returns - the bearing */ export declare function pointBearing<A extends MValue = Properties, B extends MValue = Properties>(start: VectorPoint<A>, end: VectorPoint<B>): number; /** * Get the destination given a start point, bearing, and distance * @param start - starting point (in Lon-Lat degrees) * @param bearing - the bearing (in degrees) * @param distance - the distance (in meters) * @param radius - the radius of the sphere. Defaults to the Earth's radius in meters. * @returns - the destination point in Lon-Lat degrees */ export declare function pointDestination<D extends MValue = Properties>(start: VectorPoint<D>, bearing: number, distance: number, radius?: number): VectorPoint; /** * Updates the WGS84 point's x and y values as needed * @param point - the WGS 84 point to clamp/wrap * @returns the point itself post update */ export declare function clampWGS84Point<D extends MValue = Properties>(point: VectorPoint<D>): VectorPoint<D>; //# sourceMappingURL=points.d.ts.map