TopoJSON (.topojson)
Background & Context

-
- TopoJSON GIS format.
- Geospatial data interchange format based on JavaScript Object Notation (JSON).
- An extension of the GeoJSON format.
- Suitable for encoding geographic data into shared topology.
Import

- Import["file.topojson"] imports the data associated to the vector geo primitives stored in the given file.
- Import["file.topojson",elem] imports the specified element from a OSM file.
- Import["file.topojson",{{elem1},{elem2},…}}] imports multiple elements.
- The import format can be specified with Import["file","TopoJSON"] or Import["file",{"TopoJSON",elem,…}].
- See the following reference pages for full general information:
-
Import import from a file CloudImport import from a cloud object ImportString import from a string ImportByteArray import from 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" graphics primitives for each layer "Graphics" all layers combined into a single graphics object "GraphicsList" list of graphics representing the layers of an OSM archive - Import by default uses the "Graphics" element for the TopoJSON format.
- Import["file","Data"] returns an expression of the form {layer1,layer2,…} . Individual layers are given as a list of rules representing the geometry, as well as numerical and textual information associated with the features.
- Metainformation elements:
-
"LayerNames" all layer names, given as a list of strings "LayerTypes" what graphics primitives comprise each layer "SpatialRange" range of geographic coordinates, typically given in decimal degrees - The TopoJSON format does not contain information about the coordinate reference system being used. GeoGraphics will assume that this data corresponds to the "Equirectangular" projection in degrees.
- Accessing low-level metainformation from the file:
-
"CoordinateSystemInformation" raw parameters of the coordinate system as stored in the file - See the reference page for GeoProjectionData for full information on cartographic projections.
Options

- General rendering options:
-
GeoBackground Automatic background style ImageSize Automatic overall size of the image
Examples
open all close allBasic Examples (1)
Import a JSON file in the TopoJSON format, rendering its contents as a GeoGraphics object:
Import Elements (7)
Data Representation (3)
"Graphics" (1)
Import the full set of graphics primitives and represent them using GeoGraphics:
Related Guides
History
Introduced in 2025 (14.3)