turf-inside

WebJar for turf-inside

License

License

MIT
Categories

Categories

IDE Development Tools
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-inside
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-inside
WebJar for turf-inside
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Turfjs/turf-inside

Download turf-inside

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : turf-invariant jar [3.0.12,4)

Project Modules

There are no modules declared in this project.

DEPRECATED - replaced by @turf/boolean-point-in-polygon

turf-inside

build status

turf inside module

turf.inside(point, polygon)

Takes a Point and a Polygon or MultiPolygon and determines if the point resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.

Parameters

parameter type description
point Feature.<Point> input point
polygon Feature.<Polygon MultiPolygon>

Example

var pt1 = {
  "type": "Feature",
  "properties": {
    "marker-color": "#f00"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-111.467285, 40.75766]
  }
};
var pt2 = {
  "type": "Feature",
  "properties": {
    "marker-color": "#0f0"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-111.873779, 40.647303]
  }
};
var poly = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-112.074279, 40.52215],
      [-112.074279, 40.853293],
      [-111.610107, 40.853293],
      [-111.610107, 40.52215],
      [-112.074279, 40.52215]
    ]]
  }
};

var features = {
  "type": "FeatureCollection",
  "features": [pt1, pt2, poly]
};

//=features

var isInside1 = turf.inside(pt1, poly);
//=isInside1

var isInside2 = turf.inside(pt2, poly);
//=isInside2

Returns Boolean, true if the Point is inside the Polygon; false if the Point is not inside the Polygon

Installation

Requires nodejs.

$ npm install turf-inside

Tests

$ npm test
org.webjars.npm

turf

a fast and fully featured open gis engine written in javascript

Versions

Version
3.0.12