Wednesday 5 June 2019

Command line-tool to convert geojson file to line-delimited geojson


I'm loving the ndjson-cli tools for working with newline-delimited GeoJSON files. But I can't seem to find a tool that converts a standard GeoJSON (whether minified or prettified) ond converts it to newline-delimited. Is there one?



Answer



I wrote a dedicated command-line tool on NPM to do this, now:


https://www.npmjs.com/package/geojson2ndjson


Usage


npm install -g geojson2ndjson geojson2ndjson myfile.geojson | ...



Or read from standard input:


cat myfile.geojson | geojson2ndjson | ...


Examples


List the properties of every feature, without the geometries:


geojson2ndjson myfile.geojson | ndjson-map d.properties



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...