Skip to main content

🌍 GeoJSON Writer

The GeoJSON writer exports results as GeoJSON, a lightweight, web-native geospatial format.
It is the most flexible writer in Geoflip, supporting two delivery modes:

  • File output — a downloadable .geojson file
  • Inline output — JSON streamed directly in the API response (only supported for GeoJSON)

📜 Format Details

  • File type: .geojson (UTF-8 encoded)

  • MIME type: application/geo+json (for files) or application/json (for inline)

  • Delivery: controlled by output.to_file in your config:

    • true → returns a downloadable file (default)
    • false → returns raw JSON directly in the API response
  • CRS handling: Always assumed to be EPSG:4326 (WGS84), per GeoJSON specification. Reprojection happens automatically if you specify a different output.epsg.


⚙️ Example Config (File Output)

{
"input": { "format": "shp" },
"transformations": [
{ "type": "union" }
],
"output": {
"format": "geojson",
"epsg": 4326,
"to_file": true
}
}

📑 Example API Call (File Output)

curl -X POST https://api.geoflip.io/transform \
-F 'config={
"input":{"format":"shp"},
"transformations":[{"type":"union"}],
"output":{"format":"geojson","epsg":4326,"to_file":true}
}' \
-F "input_file=@/path/to/parcels.zip;type=application/zip"

Response

{ "job_id": "abcd-ef01-2345-6789" }

Poll job status:

curl https://api.geoflip.io/result/status/abcd-ef01-2345-6789

Download the .geojson file once status is SUCCESS:

curl -O https://api.geoflip.io/result/output/abcd-ef01-2345-6789

⚙️ Example Config (Inline Output)

{
"input": { "format": "dxf", "epsg": 28350 },
"transformations": [
{ "type": "buffer", "params": { "distance": 250, "units": "meters" } }
],
"output": {
"format": "geojson",
"epsg": 4326,
"to_file": false
}
}

📑 Example API Call (Inline Output)

curl -X POST https://api.geoflip.io/transform \
-F 'config={
"input":{"format":"dxf","epsg":28350},
"transformations":[{"type":"buffer","params":{"distance":250,"units":"meters"}}],
"output":{"format":"geojson","epsg":4326,"to_file":false}
}' \
-F "input_file=@/path/to/alignments.dxf;type=application/dxf"

Response (inline GeoJSON)

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Polygon", "coordinates": [...] },
"properties": {}
}
]
}

No file is created — the GeoJSON data is streamed directly in the HTTP response.


✅ Notes

  • Only GeoJSON supports to_file=false inline output.
  • Inline output is useful for lightweight, programmatic integrations where you want JSON directly in your client app.
  • For larger datasets or when distributing results, use file output.

➡️ Next Steps