.GEOJSON
GeoJSON
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.
Software
- QGIS (Windows, macOS, Linux)
- geojson.io, a web editor that draws the file on a map
- ArcGIS Pro (Windows)
- GDAL and its
ogr2ogrconverter (Windows, macOS, Linux) - Leaflet, a JavaScript library that shows GeoJSON on web maps
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