Skip to content

Convert a GeoJSON file into newline-delimited JSON output, one line per feature.

Notifications You must be signed in to change notification settings

stevage/geojson2ndjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geojson2ndjson

Converts a GeoJSON file on disk into a newline-delimited output, following the ndjson specification. So you can combine it with the ndjson-cli tools, for instance.

Usage

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

Or read from standard input:

cat myfile.geojson | geojson2ndjson | ...

Or multiple files:

geojson2ndjson *.geojson > everything.nd.json

ndjson2geojson

Converts a line-delimited GeoJSON file on disk into regular GeoJSON output, with no validation.

Usage

npm install -g geojson2ndjson
ndjson2geojson myfile.json | ...

Or read from standard input:

cat myfile.json | ndjson2geojson | ...

Examples

List the properties of every feature, without the geometries:

geojson2ndjson myfile.geojson | ndjson-map d.properties

Remove every property except "name" from a GeoJSON file:

geojson2ndjson myfile.geojson | ndjson-map 'd.properties = {name: d.properties.name}, d' | ndjson2geojson > myfile-out.geojson

About

Convert a GeoJSON file into newline-delimited JSON output, one line per feature.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published