geojson-split-crossing-lines

1.0.2 • Public • Published

geojson-split-crossing-lines

Turn a GeoJSON FeatureCollection of crossing lines into a clean network dataset.

npm install geojson-split-crossing-lines --save
const splitLines = require('geojson-split-crossing-lines');
const fs = require('fs').promises;
 
main();
 
async function main() {
    // load and parse GeoJSON LineString dataset
    const geo_raw = await fs.readFile('./whole.geojson', 'utf8');
    const geo = JSON.parse(geo_raw);
 
    const split = splitLines(geo);
 
    await fs.writeFile('./split.geojson', JSON.stringify(split), 'utf8');
}

For more information, please see my blog post; Cleaning a GeoJSON Network.

Readme

Keywords

none

Package Sidebar

Install

npm i geojson-split-crossing-lines

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

6.25 kB

Total Files

5

Last publish

Collaborators

  • royhobbstn