# GeoJSON to CSV Converter

Flatten GeoJSON features into CSV rows with property columns, WKT or longitude/latitude geometry, nested-field flattening, and delimiter options.

## Run it

- **CLI:** `gizza tool geojson-to-csv '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"Alpha","pop":1200},"geometry":{"type":"Point","coordinates":[-105,40]}}]}'`
- **Web:** https://gizza.ai/tools/geojson-to-csv/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/geojson-to-csv/tool.json

## Inputs

- `geojson` — GeoJSON _(field)_
- `geometry` — Geometry columns _(field)_
- `nested` — Nested properties _(field)_
- `delimiter` — Delimiter _(field)_
- `header` — Include header row _(field)_

## Output

- CSV (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `geojson` — GeoJSON
- `geometry` — Geometry columns
- `nested` — Nested properties
- `delimiter` — Delimiter
- `header` — Include header row

Example: `https://gizza.ai/tools/geojson-to-csv/?geojson=%7B%22type%22%3A%22FeatureCollection%22%2C%22features%22%3A%5B%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%22name%22%3A%22Alpha%22%2C%22pop%22%3A1200%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Point%22%2C%22coordinates%22%3A%5B-105%2C40%5D%7D%7D%5D%7D&geometry=wkt&nested=json&delimiter=comma&header=true`

---

## About this tool

GeoJSON is great for maps, but a spreadsheet or BI tool often wants one row per
feature. This converter flattens a GeoJSON `FeatureCollection`, a single `Feature`,
a bare geometry, or an array of those into CSV:

- every `properties` key becomes a column, using the union of keys across all
  features in first-seen order;
- missing property values are blank;
- geometry can be emitted as a 2-D WKT `geometry` column, `longitude`/`latitude`
  columns from the first coordinate, both, or omitted;
- nested properties can stay as compact JSON text or expand to dot-notated columns
  such as `address.city` and `tags.0`.

All conversion runs locally in your browser.

### Worked example

Input:

```json
{"type":"FeatureCollection","features":[
  {"type":"Feature","properties":{"name":"Alpha","pop":1200},"geometry":{"type":"Point","coordinates":[-105,40]}},
  {"type":"Feature","properties":{"name":"Beta","pop":800},"geometry":{"type":"Point","coordinates":[-106.5,41.25]}}
]}
```

With the default `geometry = wkt`, the output is:

```csv
name,pop,geometry
Alpha,1200,POINT (-105 40)
Beta,800,POINT (-106.5 41.25)
```

Set `geometry = lonlat` if your spreadsheet wants coordinate columns instead.

## FAQ

<details>
<summary>What GeoJSON inputs are accepted?</summary>

You can paste a `FeatureCollection`, a single `Feature`, a bare geometry such as a
`Point` or `Polygon`, or a top-level array of features/geometries. A bare geometry
has no properties, so the CSV contains only geometry columns unless you choose
`geometry = none` (which would leave nothing to output).

</details>

<details>
<summary>How are geometry coordinates represented?</summary>

`geometry = wkt` writes one `geometry` column as Well-Known Text, which works for
points, lines, polygons, multi-geometries, and geometry collections. `geometry =
lonlat` writes the first coordinate as `longitude` and `latitude`; for lines and
polygons this is the first vertex. `both` emits both representations.

</details>

<details>
<summary>What happens to nested properties?</summary>

By default, nested objects and arrays stay in a single cell as compact JSON so no
information is lost. Choose `nested = flatten` to expand them into dot-notated leaf
columns, for example `address.city` or `tags.0`.

</details>

<details>
<summary>Does this reproject coordinates?</summary>

No. GeoJSON coordinates are used exactly as provided, normally `[longitude,
latitude]` in WGS84. Reprojection, simplification, topology repair, and format
exports such as Shapefile/GeoPackage are GIS processing tasks outside this small
CSV flattener.

</details>

## Related tools

- [Amazon Order Analyzer](https://gizza.ai/tools/amazon-order-analyzer/): Paste an Amazon order-history CSV export to summarize total spend by month, top items, and category breakdowns. Browser-only, private, with Markdown or JSON output.
- [Avro to JSON Converter](https://gizza.ai/tools/avro-to-json/): Decode Apache Avro Object Container Files (.avro / OCF) to JSON, NDJSON, or the embedded schema — no .avsc needed, free and private in your browser.
- [Reconcile bank statement and ledger CSVs](https://gizza.ai/tools/bank-statement-reconcile/): Match bank-statement CSV rows to ledger rows by date, signed amount, and fuzzy memo similarity, with unmatched and suggested matches.
- [Bencode decoder](https://gizza.ai/tools/bencode-decoder/): Decode bencode (the BitTorrent / .torrent serialization format) into readable JSON, and re-encode JSON back into canonical bencode — in your browser. Nothing is uploaded.
- [Budget Planner](https://gizza.ai/tools/budget-planner/): Plan a monthly budget from take-home pay: 50/30/20 needs/wants/savings targets with custom splits, or a zero-based plan showing what's left to allocate.
