GeoJSON

Last updated

GeoJSON
Filename extensions .json, .geojson
Internet media type application/geo+json [1]
Type of format GIS file format
Extended from JSON
Standard RFC   7946
Open format?yes
Website geojson.org

GeoJSON [1] is an open standard format designed for representing simple geographical features, along with their non-spatial attributes. It is based on the JSON format.

Contents

The features include points (therefore addresses and locations), line strings (therefore streets, highways and boundaries), polygons (countries, provinces, tracts of land), and multi-part collections of these types. GeoJSON features need not represent entities of the physical world only; mobile routing and navigation apps, for example, might describe their service coverage using GeoJSON. [2]

The GeoJSON format differs from other GIS standards in that it was written and is maintained not by a formal standards organization, but by an Internet working group of developers. [3]

A notable offspring of GeoJSON is TopoJSON, an extension of GeoJSON that encodes geospatial topology and that typically provides smaller file sizes.

History

The GeoJSON format working group and discussion were begun in March 2007 [4] and the format specification was finalized in June 2008.

In April 2015 the Internet Engineering Task Force founded the Geographic JSON working group [5] which released GeoJSON as RFC 7946 in August 2016.

Example

{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[102.0,0.5]},"properties":{"prop0":"value0"}},{"type":"Feature","geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]},"properties":{"prop0":"value0","prop1":0.0}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]},"properties":{"prop0":"value0","prop1":{"this":"that"}}}]}

Geometries

Points are [x, y] or [x, y, z]. They may be [longitude, latitude] or [eastings, northings]. Elevation, in meters [6] , is an optional third number. They are decimal numbers. [7]

For example, London (51.5074° North, 0.1278° West) is [-0.1278, 51.5074]

Geometry primitives
TypeExamples
Point SFA Point.svg
{"type":"Point","coordinates":[30.0,10.0]}
LineString SFA LineString.svg
{"type":"LineString","coordinates":[[30.0,10.0],[10.0,30.0],[40.0,40.0]]}
Polygon SFA Polygon.svg
{"type":"Polygon","coordinates":[[[30.0,10.0],[40.0,40.0],[20.0,40.0],[10.0,20.0],[30.0,10.0]]]}
SFA Polygon with hole.svg
{"type":"Polygon","coordinates":[[[35.0,10.0],[45.0,45.0],[15.0,40.0],[10.0,20.0],[35.0,10.0]],[[20.0,30.0],[35.0,35.0],[30.0,20.0],[20.0,30.0]]]}
Multipart geometries
TypeExamples
MultiPoint SFA MultiPoint.svg
{"type":"MultiPoint","coordinates":[[10.0,40.0],[40.0,30.0],[20.0,20.0],[30.0,10.0]]}
MultiLineString SFA MultiLineString.svg
{"type":"MultiLineString","coordinates":[[[10.0,10.0],[20.0,20.0],[10.0,40.0]],[[40.0,40.0],[30.0,30.0],[40.0,20.0],[30.0,10.0]]]}
MultiPolygon SFA MultiPolygon.svg
{"type":"MultiPolygon","coordinates":[[[[30.0,20.0],[45.0,40.0],[10.0,40.0],[30.0,20.0]]],[[[15.0,5.0],[40.0,10.0],[10.0,20.0],[5.0,10.0],[15.0,5.0]]]]}
SFA MultiPolygon with hole.svg
{"type":"MultiPolygon","coordinates":[[[[40.0,40.0],[20.0,45.0],[45.0,30.0],[40.0,40.0]]],[[[20.0,35.0],[10.0,30.0],[10.0,10.0],[30.0,5.0],[45.0,20.0],[20.0,35.0]],[[30.0,20.0],[20.0,15.0],[20.0,25.0],[30.0,20.0]]]]}
GeometryCollection SFA GeometryCollection.svg
{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[40.0,10.0]},{"type":"LineString","coordinates":[[10.0,10.0],[20.0,20.0],[10.0,40.0]]},{"type":"Polygon","coordinates":[[[40.0,40.0],[20.0,45.0],[45.0,30.0],[40.0,40.0]]]}]}

TopoJSON

TopoJSON is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. [8] Arcs are sequences of points, while line strings and polygons are defined as sequences of arcs. Each arc is defined only once, but can be referenced several times by different shapes, thus reducing redundancy and decreasing the file size. [9] In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms.

A reference implementation of the TopoJSON specification is available as a command-line tool to encode TopoJSON from GeoJSON (or ESRI Shapefiles) and a client side JavaScript library to decode TopoJSON back to GeoJSON again. TopoJSON is also supported by the popular OGR tool as of version 1.11 [10] and PostGIS as of version 2.1.0. [11]

TopoJSON Schema

Given a GIS shape near coordinates latitude 0° and longitude 0°, a simple but valid and complete topojson file containing all metadata, Polygon, LineString, Point elements, arcs and properties is defined as follows:

Topojson shapes Topojson shapes-en.svg
Topojson shapes
{"type":"Topology","transform":{"scale":[1,1],"translate":[0,0]},"objects":{"two-squares":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[0,1]],"properties":{"name":"Left_Polygon"}},{"type":"Polygon","arcs":[[2,-1]],"properties":{"name":"Right_Polygon"}}]},"one-line":{"type":"GeometryCollection","geometries":[{"type":"LineString","arcs":[3],"properties":{"name":"Under_LineString"}}]},"two-places":{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[0,0],"properties":{"name":"Origine_Point"}},{"type":"Point","coordinates":[0,-1],"properties":{"name":"Under_Point"}}]}},"arcs":[[[1,2],[0,-2]],[[1,0],[-1,0],[0,2],[1,0]],[[1,2],[1,0],[0,-2],[-1,0]],[[0,-1],[2,0]]]}

See also

Related Research Articles

<span class="mw-page-title-main">Vector graphics</span> Computer graphics images defined by points, lines and curves

Vector graphics are a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display and printing hardware, vector data models and file formats, as well as the software based on these data models. Vector graphics are an alternative to raster or bitmap graphics, with each having advantages and disadvantages in specific situations.

<span class="mw-page-title-main">PostGIS</span> Geospatial extension for the PostgreSQL Database

PostGIS is an open source software program that adds support for geographic objects to the PostgreSQL object-relational database. PostGIS follows the Simple Features for SQL specification from the Open Geospatial Consortium (OGC).

<span class="mw-page-title-main">Geography Markup Language</span> XML grammar for geographical features

The Geography Markup Language (GML) is the XML grammar defined by the Open Geospatial Consortium (OGC) to express geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet. Key to GML's utility is its ability to integrate all forms of geographic information, including not only conventional "vector" or discrete objects, but coverages and sensor data.

A coverage is the digital representation of some spatio-temporal phenomenon. ISO 19123 provides the definition:

vCard, also known as VCF, is a file format standard for electronic business cards. vCards can be attached to e-mail messages, sent via Multimedia Messaging Service (MMS), on the World Wide Web, instant messaging, NFC or through QR code. They can contain name and address information, phone numbers, e-mail addresses, URLs, logos, photographs, and audio clips.

A GIS file format is a standard for encoding geographical information into a computer file, as a specialized type of file format for use in geographic information systems (GIS) and other geospatial applications. Since the 1970s, dozens of formats have been created based on various data models for various purposes. They have been created by government mapping agencies, GIS software vendors, standards bodies such as the Open Geospatial Consortium, informal user communities, and even individual developers.

<span class="mw-page-title-main">JSON</span> Open standard file format and data interchange

JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays. It is a commonly used data format with diverse uses in electronic data interchange, including that of web applications with servers.

<span class="mw-page-title-main">Shapefile</span> Geospatial vector data format

The shapefile format is a geospatial vector data format for geographic information system (GIS) software. It is developed and regulated by Esri as a mostly open specification for data interoperability among Esri and other GIS software products. The shapefile format can spatially describe vector features: points, lines, and polygons, representing, for example, water wells, rivers, and lakes. Each item usually has attributes that describe it, such as name or temperature.

<span class="mw-page-title-main">ArcGIS</span> Geographic information system maintained by Esri

ArcGIS is a family of client, server and online geographic information system (GIS) software developed and maintained by Esri.

gvSIG Desktop application for working with geographic data

gvSIG, geographic information system (GIS), is a desktop application designed for capturing, storing, handling, analyzing and deploying any kind of referenced geographic information in order to solve complex management and planning problems. gvSIG is known for having a user-friendly interface, being able to access the most common formats, both vector and raster ones. It features a wide range of tools for working with geographic-like information.

<span class="mw-page-title-main">180th meridian</span> Line of longitude

The 180th meridian or antimeridian is the meridian 180° both east and west of the prime meridian in a geographical coordinate system. The longitude at this line can be given as either east or west.

A spatial database is a general-purpose database that has been enhanced to include spatial data that represents objects defined in a geometric space, along with tools for querying and analyzing such data.

JTS Topology Suite is an open-source Java software library that provides an object model for Euclidean planar linear geometry together with a set of fundamental geometric functions. JTS is primarily intended to be used as a core component of vector-based geomatics software such as geographical information systems. It can also be used as a general-purpose library providing algorithms in computational geometry.

Well-known text (WKT) is a text markup language for representing vector geometry objects. A binary equivalent, known as well-known binary (WKB), is used to transfer and store the same information in a more compact form convenient for computer processing but that is not human-readable. The formats were originally defined by the Open Geospatial Consortium (OGC) and described in their Simple Feature Access. The current standard definition is in the ISO/IEC 13249-3:2016 standard.

A georelational data model is a geographic data model that represents geographic features as an interrelated set of spatial and attribute data. The georelational model was the dominant form of vector file format during the 1980s and 1990s, including the Esri coverage and Shapefile.

A geographic data model, geospatial data model, or simply data model in the context of geographic information systems, is a mathematical and digital structure for representing phenomena over the Earth. Generally, such data models represent various aspects of these phenomena by means of geographic data, including spatial locations, attributes, change over time, and identity. For example, the vector data model represents geography as collections of points, lines, and polygons, and the raster data model represent geography as cell matrices that store numeric values. Data models are implemented throughout the GIS ecosystem, including the software tools for data management and spatial analysis, data stored in a variety of GIS file formats, specifications and standards, and specific designs for GIS installations.

geo URI scheme System of geographic location identifiers

The geo URI scheme is a Uniform Resource Identifier (URI) scheme defined by the Internet Engineering Task Force's RFC 5870 as:

a Uniform Resource Identifier (URI) for geographic locations using the 'geo' scheme name. A 'geo' URI identifies a physical location in a two- or three-dimensional coordinate reference system in a compact, simple, human-readable, and protocol-independent way.

Geospatial PDF is a set of geospatial extensions to the Portable Document Format (PDF) 1.7 specification to include information that relates a region in the document page to a region in physical space — called georeferencing. A geospatial PDF can contain geometry such as points, lines, and polygons. These, for example, could represent building locations, road networks and city boundaries, respectively. The georeferencing metadata for geospatial PDF is most commonly encoded in one of two ways: the OGC best practice; and as Adobe's proposed geospatial extensions to ISO 32000. The specifications also allow geometry to have attributes, such as a name or identifying type.

<span class="mw-page-title-main">DE-9IM</span> Topological model

The Dimensionally Extended 9-Intersection Model (DE-9IM) is a topological model and a standard used to describe the spatial relations of two regions, in geometry, point-set topology, geospatial topology, and fields related to computer spatial analysis. The spatial relations expressed by the model are invariant to rotation, translation and scaling transformations.

The Esri TIN format is a popular yet proprietary geospatial vector data format for geographic information system (GIS) software for storing elevation data as a triangulated irregular network. It is developed and regulated by Esri, US. The Esri TIN format can spatially describe elevation information including breaking edge features. Each points and triangle can carry a tag information. A TIN stored in this file format can have any shape, cover multiple regions and contain holes.

References

  1. 1 2 Butler, Howard; Daly, Martin; Doyle, Allan; Gillies, Sean; Hagen, Stefan; Schaub, Tim (August 2016). RFC 7946. IETF. doi: 10.17487/RFC7946 .
  2. "Providing Directions". developer.apple.com.
  3. "GeoJSON Info Page". lists.geojson.org.
  4. "The GeoJSON March 2007 Archive by thread". lists.geojson.org.
  5. "Geographic JSON (geojson) -". datatracker.ietf.org.
  6. Butler, H.; Daly, M.; Doyle, A.; Gillies, Sean; Schaub, T.; Hagen, Stefan (August 2016). The GeoJSON Format (Report). Internet Engineering Task Force.
  7. Butler, H.; Daly, M.; Doyle, A.; Gillies, Sean; Schaub, T.; Hagen, Stefan (August 2016). "GeoJSON RFC #3.1.1".
  8. "topojson/topojson-specification". 11 December 2020 via GitHub.
  9. "topojson/topojson". GitHub.
  10. "Release/1.11.0-News – GDAL". trac.osgeo.org.
  11. "AsTopoJSON". postgis.net.

Sources