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

turf-clip

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-clip

Clip one featurecollection by another.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
147
increased by188.24%
Maintainers
1
Weekly downloads
 
Created
Source

turf-clip

Clip one featurecollection by another.

turf.clip(clipping_geojson, input_geojson)

Takes a clipping_geojson to clip the input_geojson.

Parameters

parametertypedescription
clipping_geojsonFeatureCollectionClip FeatureCollection
input_geojsonFeatureCollectionFeatureCollection to be clipped

Example

screenshot

var clipping_geojson={
     "type": "FeatureCollection",
     "features": [{
       "type": "Feature",
       "properties": {},
       "geometry": {
         "type": "Polygon",
         "coordinates": [
           [
             [
               110.85205078124999,
               31.74685416292141
             ],
             [
               110.85205078124999,
               35.04798673426734
             ],
             [
               117.44384765625,
               35.04798673426734
             ],
             [
               117.44384765625,
               31.74685416292141
             ],
             [
               110.85205078124999,
               31.74685416292141
             ]
           ]
         ]
       }
     }]
   };
var input_geojson={
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              113.367919921875,
              35.36217605914681
            ],
            [
              111.97265625,
              30.694611546632277
            ],
            [
              116.12548828124999,
              30.93050081760779
            ],
            [
              114.93896484374999,
              35.69299463209881
            ],
            [
              113.367919921875,
              35.36217605914681
            ]
          ]
        ]
      }
    }
  ]
};
var result = turf.clip(clipping_geojson, input_geojson);

//=result

Returns FeatureCollection,

Installation

Requires nodejs.

$ npm install turf-clip

Tests

$ npm run test

Keywords

FAQs

Package last updated on 11 Sep 2016

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