|
|
4 mesi fa | |
|---|---|---|
| .. | ||
| dist | 4 mesi fa | |
| LICENSE | 4 mesi fa | |
| README.md | 4 mesi fa | |
| package.json | 4 mesi fa | |
Calculates the distance from a point to the edges of a polygon or multi-polygon. Returns negative values for points inside the polygon. Handles polygons with holes and multi-polygons. A hole is treated as the exterior of the polygon.
point (Feature<Point> | Point | Position) Input pointpolygonOrMultiPolygon (Feature<(Polygon | MultiPolygon)> | Polygon | MultiPolygon) Input polygon or multipolygonoptions Object Optional parameters (optional, default {})
options.units Units Units of the result e.g. "kilometers", "miles", "meters"options.method ("geodesic" | "planar") Method of the resultReturns number Distance in meters (negative values for points inside the polygon)
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Install this single module individually:
$ npm install @turf/point-to-polygon-distance
Or install the all-encompassing @turf/turf module that includes all modules as functions:
$ npm install @turf/turf