Newline-delimited GeoJSON

Newline-delimited GeoJSON (also known as "line-oriented GeoJSON", "GeoJSONL", "GeoJSONSeq" or "GeoJSON Text Sequences") is a text-based geospatial file format that is particularly convenient for transformation and processing. Each line can be read independently, parsed, and processed, without the entire file ever having to be parsed in memory, which is great for huge files.

It is simply newline-oriented JSON applied to GeoJSON, and formalised as RFC 8142.

  1. Remove the top-level FeatureCollection.
  2. Output each Feature minified, on its own line, separated by \n.
  3. Don't include commas between Features.

Normal GeoJSON

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "properties": {
                "name": "Melbourne"
            }, "geometry": {
                "type": "Point",
                "coordinates": [
                    144.9584,
                    -37.8173
                ]
            }
        }, {
            "type": "Feature",
            "properties": {
                "name": "Canberra"
            }, "geometry": {
                "type": "Point",
                "coordinates": [
                    149.1009,
                    -35.3039
                ]
            }
        }, {
            "type": "Feature",
            "properties": {
                "name": "Sydney"
            }, "geometry": {
                "type": "Point",
                "coordinates": [
                    151.2144,
                    -33.8766
                ]
            }
        }
    ]
}
                    

Newline-delimited GeoJSON

{"type":"Feature","properties":{"name":"Melbourne"},"geometry":{"type":"Point","coordinates":[144.9584,-37.8173]}}
{"type":"Feature","properties":{"name":"Canberra"},"geometry":{"type":"Point","coordinates":[149.1009,-35.3039]}}
{"type":"Feature","properties":{"name":"Sydney"},"geometry":{"type":"Point","coordinates":[151.2144,-33.8766]}}
                    

Tools

These tools support newline-delimited GeoJSON: These tools work on newline-delimited JSON and are also useful for newline-delimited GeoJSON:

Resources

Created by Steve Bennett (@stevage1).