GeoJSON is a standard format for encoding geographic data structures using JSON. It's used by mapping libraries, GIS tools, and location-based services.
GeoJSON Structure
Every GeoJSON object has a type property:
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-73.9857, 40.7484]
},
"properties": {
"name": "Empire State Building",
"city": "New York"
}
}
Geometry Types
GeoJSON supports seven geometry types:
Point — Single location:
{ "type": "Point", "coordinates": [102.0, 0.5] }
LineString — Path between points:
{ "type": "LineString", "coordinates": [[102.0, 0.0], [103.0, 1.0]] }
Polygon — Area with boundary:
{
"type": "Polygon",
"coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]
}
Other types: MultiPoint, MultiLineString, MultiPolygon, GeometryCollection.
Feature Collection
Group multiple features:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-73.9857, 40.7484] },
"properties": { "name": "Empire State Building" }
},
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-73.9851, 40.7589] },
"properties": { "name": "Rockefeller Center" }
}
]
}
Coordinate Order
GeoJSON uses [longitude, latitude] (x, y) order, not [lat, lng]. This is a common source of errors.
Popular Libraries
Tips
"crs" property if not using default WGS84Validate your GeoJSON with our JSON Validator and explore structure with JSON Viewer.