JSPM

@turf/point-to-polygon-distance

7.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 382777
  • Score
    100M100P100Q204286F
  • License MIT

Calculates the distance from a point to the edges of a polygon or multi-polygon.

Package Exports

  • @turf/point-to-polygon-distance
  • @turf/point-to-polygon-distance/package.json

Readme

@turf/point-to-polygon-distance

pointToPolygonDistance

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.

Parameters

  • Throws Error If input geometries are invalid

Returns 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.

Installation

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