Socket
Socket
Sign inDemoInstall

turf-filter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-filter

turf filter module


Version published
Maintainers
1
Created
Source

turf-filter

Build Status

Keeps any features from a feature collection that match a property value.

###Install

npm install turf-filter

###Parameters

namedescription
fcA FeatureCollection
propertyProperty to check
valueValue for features to keep

###Usage

filter(fc, property, value)

###Example

var filter = require('turf-filter')
var point = require('turf-point')
var featurecollection = require('turf-featurecollection')

var trees = featurecollection([
	  point(1,2, {species: 'oak'}),
	  point(2,1, {species: 'birch'}),
	  point(3,1, {species: 'oak'}),
	  point(2,2, {species: 'redwood'}),
	  point(2,3, {species: 'maple'}),
	  point(4,2, {species: 'oak'})
  ])

var filtered = filter(trees, 'species', 'oak')
  
console.log(filtered)

Keywords

FAQs

Package last updated on 17 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