geojson-split-crossing-lines
v1.0.2
Published
split collection of crossing lines
Downloads
1
Readme
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.