7.2.0 • Published 23 days ago
@turf/point-on-feature v7.2.0
@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
geojson
GeoJSON any Feature or FeatureCollection
Examples
var polygon = turf.polygon([[
[116, -36],
[131, -32],
[146, -43],
[155, -25],
[133, -9],
[111, -22],
[116, -36]
]]);
var pointOnPolygon = turf.pointOnFeature(polygon);
//addToMap
var addToMap = [polygon, pointOnPolygon];
Returns Feature<Point> a point on the surface of input
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
7.2.0
23 days ago
7.1.0
5 months ago
7.1.0-alpha.70
5 months ago
7.0.0
8 months ago
7.1.0-alpha.7
7 months ago
7.0.0-alpha.116
9 months ago
7.0.0-alpha.115
9 months ago
7.0.0-alpha.114
10 months ago
7.0.0-alpha.113
12 months ago
7.0.0-alpha.111
1 year ago
7.0.0-alpha.110
1 year ago
7.0.0-alpha.1
1 year ago
7.0.0-alpha.2
1 year ago
7.0.0-alpha.0
2 years ago
6.5.0
4 years ago
6.4.0
4 years ago
6.3.0
4 years ago
6.2.0
4 years ago
6.2.0-alpha.3
4 years ago
6.2.0-alpha.2
5 years ago
6.2.0-alpha.1
5 years ago
5.1.5
7 years ago
5.1.0
7 years ago
5.0.4
7 years ago
5.0.0
7 years ago