@webgeodatavore/geojson-line-chunk

Only working on GeoJSON with featureCollection as input. It output GeoJSON

Usage no npm install needed!

<script type="module">
  import webgeodatavoreGeojsonLineChunk from 'https://cdn.skypack.dev/@webgeodatavore/geojson-line-chunk';
</script>

README

Utility to chunk GeoJSON lines

Only working on GeoJSON with featureCollection as input. It output GeoJSON

Install

npm i @webgeodatavore/geojson-line-chunk -g

Examples

cat mygeojson.json | geojson-line-chunk --distance 500 --units kilometers -
geojson-line-chunk --input myinput.json --distance 500 --units kilometers --output myoutput.json

Help content

Options:
      --version       Show version number                              [boolean]
  -i, --input         Input GeoJSON file
  -o, --output        Provide an output path for GeoJSON
  -d, -d, --distance  Provide a distance for splitting line. If not units
                      specified, it's kilometers                      [required]
  -u, --units         Units
  [choices: "degrees", "radians", "miles", "kilometers"] [default: "kilometers"]
  -r, --reverse       Reverses coordinates to start the first chunked segment at
                      the end. Default to false       [boolean] [default: false]
      --help          Show help                                        [boolean]