Socket
Socket
Sign inDemoInstall

gdalclip

Package Overview
Dependencies
73
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gdalclip

Clip geometries between two datasets while maintain the attributes from both


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

gdalClip

Clip geometries between two datasets while maintain the attributes from both.

Dependencies

  • gdal
  • uuid

Setup

npm install gdalclip

Usage

const data = gdalClip.processData(<clipFeature>, <inputFeature>, <outputName>, <outputFormat>);
  • clipFeature: Must be Polygon or MultiPolygon.
  • inputFeature: Polygon/MultiPolygon/Point/MultiPoint/Linestring/MultiLinestring
  • outputName: Path and output name for the new file [DEFAULT: shapefile with random name].
  • outputFromat: Output format that wil be used to save the data [DEFAULT: ESRI Shapefile].

Sample Usage

const gdalClip = require('gdalclip');
const gdal = require('gdal');

const getFeatures = dataset => gdal.open(dataset).layers.get(0);

const baseData = getFeatures('path/to/baseData.shp');
const clipData = getFeatures('path/to/clipData.shp');

gdalClip.processData(clipData, baseData, 'path/to/outputData.shp', 'ESRI Shapefile');

Allowed Outputs

Tested with the most common outputs that are listed on gdal. Message me on GitHub if you need some help or find some bug.

You can also use vsimem to save the data temporary on the memory. So the command would be something like:

const singleParts = gdalClip.processData.processData(inputLayer, '/vsimem/temp_output.shp', 'ESRI Shapefile')

Ilustration


=^]

Keywords

FAQs

Last updated on 05 Mar 2018

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc