The example
The JSON above is the example. Explore it in the Tree tab, press Download to save it as a .json file, or Share to send someone a link to it. All names, ids, emails and values are invented.
Fields explained
| Path | Type | Notes |
|---|---|---|
type | string | FeatureCollection holds a list of Feature objects. |
features[].properties | object | Free-form attributes such as a name. |
features[].geometry.type | string | Point, LineString, Polygon and others. |
geometry.coordinates | array | Order is [longitude, latitude], the opposite of how most people say it. |
Polygon ring | array of positions | The first and last position of a ring must be the same, so the shape is closed. |
Read it in code
JavaScript:
const [lng, lat] = data.features[0].geometry.coordinates;Python:
lng, lat = data["features"][0]["geometry"]["coordinates"]What this example is good for
- Testing map libraries
- Learning the GeoJSON structure from RFC 7946
- Checking exports from GIS tools
Tips
- Longitude comes first. Swapping the two is the most common GeoJSON bug and puts points in the wrong place.
- Coordinates are in WGS 84 degrees; large precision adds file size without adding useful accuracy.
Convert this example
Open it in a converter, then switch the output in the Code tab:
- JSON to TypeScript
- JSON to Zod
- JSON to Python (Pydantic)
- JSON to Go
- JSON to JSON Schema
- JSON to CSV
- JSON to YAML
- JSON to XML