Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-tag

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-tag

turf tag module

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
increased by5.72%
Maintainers
1
Weekly downloads
 
Created
Source

turf-tag

Build Status

Performs a spatial join on a set of points from a set of polygons.

###Install

npm install turf-inside

###Parameters

namedescription
pointsA FeatureCollection of Point Features
polygonsA FeatureCollection of Polygon Features
polyIDid field on the polygons
containingPolyIDid field to tag onto points that are in a corresponding polygon

###Usage

tag(points, polygons, 'polyID', 'containingPolyID')

###Example

var tag = require('turf-tag')
var fs = require('fs')

t.load('./testIn/tagPoints.geojson', function(err, points){
  t.load('./testIn/tagPolygons.geojson', function(err, polygons){

var pts = JSON.parse(fs.readFileSync('/path/to/pts.geojson'))
var polys = JSON.parse(fs.readFileSync('/path/to/polys.geojson'))

var tagged = tag(points, polygons, 'polyID', 'containingPolyID')

console.log(taggedPoints)

Keywords

FAQs

Package last updated on 15 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc