Package Exports
- gdalmultitosingle
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gdalmultitosingle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gdalMultiToSingle
Transform multi-part geometries to single part geometries.
Dependencies
Setup
npm install gdalmultitosingleUsage
const gdalMultiToSingle = require('gdalmultitosingle')
const outputPath = gdalMultiToSingle.processData(<inputFeatures>, <outputName>, <outputFormat>);
// Returns the output filepath.Sample Usage
const gdalMultiToSingle = require('gdalmultitosingle');
const gdal = require('gdal');
const getFeatures = dataset => gdal.open(dataset).layers.get(0);
const inputLayer = getFeatures('path/to/inputData.geojson');
const singleParts = gdalMultiToSingle.processData(inputLayer, '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 = gdalMultiToSingle.processData(inputLayer, '/vsimem/temp_output.shp', 'ESRI Shapefile')=^]