GeoJSON

From OpenStreetMap Wiki
Jump to navigation Jump to search

GeoJSON is file format for representing geodata as JSON. In this format, every Feature element has

  • a geometry of type Point, LineString, Polygon, MultiPoint, MultiLineString, or MultiPolygon,
  • and additional properties.

Read more about GeoJSON at https://geojson.org/, or GeoJSON in Wikipedia (and JSON for an introduction to the JSON base format).

Converting between OSM data and geoJSON

TODO: list more options

  • JOSM – Allows you to save to GeoJSON and re-open from it. Simply set the file extension to ".geojson" in the save dialog (Note: JOSM currently does not save projection information, and will not warn you when opening GeoJSON files with weird projections and assumes WSG-84)
  • osmium-tool has an export functionality which allows to transform OSM data to GeoJSON.
  • ogr2ogr – General tool for conversion between many geo data formats including GeoJSON and OSM XML (supported from version 2.4 and up)
  • osmtogeojson - Specialized tool to convert OSM data to GeoJSON
  • osm2geojson - OSM XML (and Overpass XML/JSON) to GeoJSON converter on Python
  • minjur – Osmium-based converter of OSM data to (line delimited) GeoJSON
  • Help question: Software/Libraries to Convert OSM Data to GeoJSON (without using API)
  • BBBike.org extract service offers GeoJSON for an area of your choosing, updated weekly

Authoring GeoJSON

Displaying GeoJSON on a map

See also

  • awesome-geojson – A collection of applications, tools, libraries, documentation, etc. dealing with GeoJSON data.
  • osm-countries-geojson – Countries GeoJSON based on OpenStreetMap data, automatically updated.