JSPM

  • Created
  • Published
  • Downloads 770927
  • Score
    100M100P100Q301209F
  • License MIT

turf point-on-feature module

Package Exports

  • @turf/point-on-feature

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@turf/point-on-feature) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@turf/point-on-feature

pointOnFeature

Takes a Feature or FeatureCollection and returns a Point guaranteed to be on the surface of the feature.

  • Given a Polygon, the point will be in the area of the polygon
  • Given a LineString, the point will be along the string
  • Given a Point, the point will the same as the input

Parameters

Examples

// create a random polygon
var polygon = turf.randomPolygon();

var pointOnPolygon = turf.pointOnFeature(polygon);

//addToMap
var addToMap = [polygon, pointOnPolygon];

Returns Feature<Point> a point on the surface of input

normalize

Normalizes any GeoJSON to a FeatureCollection

Parameters

Returns FeatureCollection FeatureCollection


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 module individually:

$ npm install @turf/point-on-feature

Or install the Turf module that includes it as a function:

$ npm install @turf/turf