Introduction
GeoJSON is a way of writing map data in JSON: points, lines and areas, each with a set of properties such as a name or a population. It was written by a group of developers in 2008 and standardised as RFC 7946 in 2016. Web maps use it widely, because JavaScript can read it directly.
Files are named .geojson, but many are saved as plain
.json.
Structure
A GeoJSON file is one JSON object whose type says what it is. Most files
are a FeatureCollection holding an array of Feature objects.
Each feature has a geometry and a properties object of any
values.
A geometry is one of seven types: Point, MultiPoint,
LineString, MultiLineString, Polygon,
MultiPolygon or GeometryCollection. Its
coordinates are arrays of positions, and each position is longitude first,
then latitude, then an optional height, in the WGS 84 system used by GPS. A polygon is
a list of rings: the outer edge first, then any holes.
{FeatureCollection the outer objectobject…Feature geometry, properties and an optional idrepeated
The objects and members page gives every type, member and rule of RFC 7946.
Also used for
- Browser extension manifest – The JSON manifest of a browser extension: its name, permissions and scripts.
- Hugging Face model config (config.json) – config.json: a model’s architecture and sizes, read before the weights.
- Hugging Face tokenizer (tokenizer.json) – tokenizer.json: a language model’s vocabulary and tokenising rules.
- JSON Schema – A JSON document that describes and validates other JSON documents.
- JavaScript Object Notation – Text format for objects, arrays, strings, numbers and booleans.
- Lottie animation – Vector animations as JSON, exported from After Effects and played in apps and web pages.
- Visual Studio Code settings – VS Code’s settings.json: dotted setting IDs in JSON with comments.
- jCal: iCalendar in JSON – iCalendar as JSON: events, to-dos and time zones as nested arrays.
- jCard: vCard in JSON – vCard 4.0 contacts as JSON: names, numbers and addresses as arrays.
- npm package manifest (package.json) – A JavaScript package’s name, version, scripts and dependencies, in JSON.
Links
Software
- QGIS – free GIS that opens, edits and saves GeoJSON layers (Windows, macOS, Linux)
- geojson.io – draws a GeoJSON file on a map and lets you edit it (web)
- ArcGIS Pro – Esri’s desktop GIS (Windows)
- GDAL – with its
ogr2ogrtool, converts GeoJSON to and from other map formats (Windows, macOS, Linux)
Developers
Reference
- RFC 7946 – The GeoJSON Format