开发者社区> 镜像站> NPM> turf-point-on-surface
turf-point-on-surface

turf point-on-surface module

Turf packages are now namespaced: please use @turf/point-on-surface instead
Last updated 4 years ago by tmcw .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install turf-point-on-surface 
SYNC missed versions from official npm registry.

turf-point-on-surface

build status

turf point-on-surface module

turf.pointOnSurface(input)

Finds a Point guaranteed to be on the surface of GeoJSON object.

  • 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

parameter type description
input GeoJSON any GeoJSON object

Example

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

// place a point on it
var pointOnPolygon = turf.pointOnSurface(polygon);

// show both of them
var fc = turf.featurecollection([polygon, pointOnPolygon]);
//=fc

Returns Feature, a point on the surface

Installation

Requires nodejs.

$ npm install turf-point-on-surface

Tests

$ npm test

Current Tags

  • 3.0.7-canary.ae89c8b3                                ...           canary (4 years ago)
  • 3.0.12                                ...           latest (4 years ago)

13 Versions

  • 3.0.12 [deprecated]           ...           4 years ago
  • 3.0.10 [deprecated]           ...           4 years ago
  • 3.0.7-canary.ae89c8b3                                ...           4 years ago
  • 3.0.5 [deprecated]           ...           5 years ago
  • 3.0.1 [deprecated]           ...           5 years ago
  • 3.0.0-canary.7879bf6c                                ...           5 years ago
  • 3.0.0-canary.2f5f7167                                ...           5 years ago
  • 1.1.1 [deprecated]           ...           6 years ago
  • 1.1.0 [deprecated]           ...           6 years ago
  • 1.0.3 [deprecated]           ...           6 years ago
  • 1.0.2 [deprecated]           ...           6 years ago
  • 1.0.1 [deprecated]           ...           6 years ago
  • 1.0.0 [deprecated]           ...           6 years ago
Downloads
Today 1
This Week 141
This Month 108
Last Day 39
Last Week 196
Last Month 820
Dependencies (5)
Dev Dependencies (2)