GeoJSON (.geojson)
Background & Context

-
- MIME type: application/geo+json.
- GeoJSON GIS format.
- Geospatial data interchange format based on JavaScript Object Notation (JSON).
- Open standard format for representing simple geographical features.
- GeoJSON identifies GeoJSON objects with list of rules in the Wolfram Language.
- GeoJSON is specified by RFC 7946.
Import

- Import["file.geojson"] imports a GeoJSON file and renders it as a GeoGraphics object.
- Import["file.geojson","elem"] imports the specified element from a GeoJSON file.
- Import["file.geojson",{{"elem1","elem2",…}}] imports multiple elements.
- Export["file.geojson",expr] exports a GeoGraphics or DynamicGeoGraphics expression to a GeoJSON file.
- Coordinate numbers where scientific notation is used are given in JSON in E notation.
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements

- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Data representation elements:
-
"Data" rule-based representation for each feature of the GeoJSON archive "Graphics" all geometric features combined into a single GeoGraphics object "GraphicsList" list of graphics representing the geometric features of a GeoJSON archive - Import by default uses the "Graphics" element for the GeoJSON format.
- Spatial information elements:
-
"CoordinateSystem" name of the coordinate reference system "SpatialRange" range of geographic coordinates, typically given in decimal degrees - Low-level meta-information from the file:
-
"CoordinateSystemInformation" raw parameters of the coordinate reference system
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Import the contents of a GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-uzt3x

Export a GeoGraphics object as a GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-1jigqu


https://wolfram.com/xid/0xayhn0jk7ic-jq8ie1


https://wolfram.com/xid/0xayhn0jk7ic-hec6tl


https://wolfram.com/xid/0xayhn0jk7ic-yq4k69
Read a GeoJSON file as a string:

https://wolfram.com/xid/0xayhn0jk7ic-ptbb0d

Import the string and interpret it as a GeoGraphics object:

https://wolfram.com/xid/0xayhn0jk7ic-ndez67

Scope (6)Survey of the scope of standard use cases
Export a GeoGraphics map as a GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-5gbph5


https://wolfram.com/xid/0xayhn0jk7ic-03h994


https://wolfram.com/xid/0xayhn0jk7ic-k6h9m4

Export a GeoGraphics object as a string using the GeoJSON format:

https://wolfram.com/xid/0xayhn0jk7ic-kmg87u

Specify explicitly the GeoJSON format to export a GeoGraphics object to a JSON file:

https://wolfram.com/xid/0xayhn0jk7ic-zsq39s


https://wolfram.com/xid/0xayhn0jk7ic-tj6x4h


https://wolfram.com/xid/0xayhn0jk7ic-i23uan


https://wolfram.com/xid/0xayhn0jk7ic-9itvy9

Export a GeoGraphics expression containing graphical directives, encoded as GeoJSON properties:

https://wolfram.com/xid/0xayhn0jk7ic-p3q0mc


https://wolfram.com/xid/0xayhn0jk7ic-8s6bxu

Import back the GeoGraphics data:

https://wolfram.com/xid/0xayhn0jk7ic-r7phii

Import a particular element from a GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-q0ahfc

Export GeoGraphics primitives and directives of different types:

https://wolfram.com/xid/0xayhn0jk7ic-gcaown


https://wolfram.com/xid/0xayhn0jk7ic-tgb2xm


https://wolfram.com/xid/0xayhn0jk7ic-ioguvi

Give the list of possible elements to import from a GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-o7eqq2


https://wolfram.com/xid/0xayhn0jk7ic-bpbgzg


https://wolfram.com/xid/0xayhn0jk7ic-gerev

Import Elements (4)
"Data" (1)
"Graphics" (1)
Import the GeoGraphics version of a GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-4ggijj

"GraphicsList" (1)
Import a GeoJSON file as a complete GeoGraphics object:

https://wolfram.com/xid/0xayhn0jk7ic-l0p9hv

Import a list of GeoGraphics objects for the respective geo primitives:

https://wolfram.com/xid/0xayhn0jk7ic-0gfb7f

"SpatialRange" (1)
Get the spatial range used in a GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-n5pcmk

Compare to the GeoJSON specification of that geo range:

https://wolfram.com/xid/0xayhn0jk7ic-qg9xay
That GeoJSON file contains only bounding box information, which is used when importing to GeoGraphics:

https://wolfram.com/xid/0xayhn0jk7ic-nmhhun

Export Options (1)
Applications (1)Sample problems that can be solved with this function
Download earthquake data for the East Coast of the US:

https://wolfram.com/xid/0xayhn0jk7ic-igz2gz
Export a GeoGraphics map of the data as a GeoJSON file, so that it can be used in other applications:

https://wolfram.com/xid/0xayhn0jk7ic-f47h4a


https://wolfram.com/xid/0xayhn0jk7ic-58diot

Verify the result, importing the "Data" element of the GeoJSON file:

https://wolfram.com/xid/0xayhn0jk7ic-b7n65f

Import the GeoJSON file using a relief geo background, to show correlation with the topography:

https://wolfram.com/xid/0xayhn0jk7ic-reg2uo
