turf-point-on-surface

WebJar for turf-point-on-surface

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-point-on-surface
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-point-on-surface
WebJar for turf-point-on-surface
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-point-on-surface

Download turf-point-on-surface

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-point-on-surface/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-point-on-surface</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-point-on-surface/
implementation 'org.webjars.npm:turf-point-on-surface:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-point-on-surface/
implementation ("org.webjars.npm:turf-point-on-surface:3.0.12")
'org.webjars.npm:turf-point-on-surface:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-point-on-surface" rev="3.0.12">
  <artifact name="turf-point-on-surface" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-point-on-surface', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-point-on-surface" % "3.0.12"
[org.webjars.npm/turf-point-on-surface "3.0.12"]

Dependencies

compile (5)

Group / Artifact Type Version
org.webjars.npm : turf-helpers jar [3.0.12,4)
org.webjars.npm : turf-explode jar [3.0.12,4)
org.webjars.npm : turf-inside jar [3.0.12,4)
org.webjars.npm : turf-distance jar [3.0.12,4)
org.webjars.npm : turf-center jar [3.0.12,4)

Project Modules

There are no modules declared in this project.

turf-point-on-surface

build status

turf point-on-surface module

turf.point-on-surface(input)

Takes a feature 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

parameter type description
input Feature,FeatureCollection any feature or set of features

Example

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

//=polygon

var pointOnPolygon = turf.pointOnSurface(polygon);

var resultFeatures = polygon.features.concat(pointOnPolygon);
var result = {
  "type": "FeatureCollection",
  "features": resultFeatures
};

//=result

Returns Feature, a point on the surface of input

Installation

Requires nodejs.

$ npm install turf-point-on-surface

Tests

$ npm test
org.webjars.npm

deprecated turf modules: do not use or reference, for redirects only

turf is now a monorepo: all turf modules are in Turfjs/turf

Versions

Version
3.0.12