turf-tag

WebJar for turf-tag

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-tag
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-tag
WebJar for turf-tag
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-tag

Download turf-tag

How to add to project

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

Dependencies

compile (1)

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

Project Modules

There are no modules declared in this project.

turf-tag

build status

turf tag module

turf.tag(points, polygons, polyId, containingPolyId)

Takes a set of Point|points and a set of Polygon|polygons and performs a spatial join.

Parameters

parameter type description
points FeatureCollection.<Point> input points
polygons FeatureCollection.<Polygon> input polygons
polyId String property in polygons to add to joined Point features
containingPolyId String property in points in which to store joined property from `polygons

Example

var bbox = [0, 0, 10, 10];
// create a triangular grid of polygons
var triangleGrid = turf.triangleGrid(bbox, 50, 'miles');
triangleGrid.features.forEach(function(f) {
  f.properties.fill = '#' +
    (~~(Math.random() * 16)).toString(16) +
    (~~(Math.random() * 16)).toString(16) +
    (~~(Math.random() * 16)).toString(16);
  f.properties.stroke = 0;
  f.properties['fill-opacity'] = 1;
});
var randomPoints = turf.random('point', 30, {
  bbox: bbox
});
var both = turf.featurecollection(
  triangleGrid.features.concat(randomPoints.features));

//=both

var tagged = turf.tag(randomPoints, triangleGrid,
                      'fill', 'marker-color');

//=tagged

Returns FeatureCollection.<Point>, points with containingPolyId property containing values from polyId

Installation

Requires nodejs.

$ npm install turf-tag

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