s2maps-gpu
Version:
S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.
16 lines (15 loc) • 1.28 kB
TypeScript
import type { MValue, Properties, VectorFeature, VectorMultiPolygon, VectorMultiPolygonGeometry, VectorPolygon, VectorPolygonGeometry } from '../../../index.js';
/**
* Find the area of a collection of polygons. Assumes geometry is in lon-lat space
* @param polygons - the collection of polygons
* @param planetRadius - the radius of the planet (Earth by default). Set to 1 if you want the raw area
* @returns - the total area of the polygon in square meters
*/
export declare function polygonsArea<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(polygons: VectorMultiPolygon<D> | VectorMultiPolygonGeometry<D> | VectorFeature<M, D, P, VectorMultiPolygonGeometry<D>>, planetRadius?: number): number;
/**
* Find the area of a polygon. Assumes geometry is in Lon-Lat space
* @param polygon - the polygon
* @param planetRadius - the radius of the planet (Earth by default)
* @returns - The approximate signed geodesic area of the polygon in square meters.
*/
export declare function polygonArea<M = Record<string, unknown>, D extends MValue = Properties, P extends Properties = Properties>(polygon: VectorPolygon<D> | VectorPolygonGeometry<D> | VectorFeature<M, D, P, VectorPolygonGeometry<D>>, planetRadius?: number): number;