mark-p-thomas : GeoJSON Glossary

These terms adhere to RFC 7946 - The GeoJSON Format.

Sections

Basic Terms

Term

Definition

Example

Bounding Box (bbox)

Information on the coordinate range for GeoJSON Geometries, Features, or FeatureCollections. At a minimum, a bounding box will have two Points or four coordinates which define the box. A 3rd dimensional bounding box can be produced if elevation or altitude is defined. The convention for the two Points is [lower-left (southwest) corner, upper-right (northeast) corner].

Often referred to as bbox.

Feature

This defines a GeoJson Feature object which represents a spatially bound thing. Every Feature object is a GeoJson object no matter where it occurs in a GeoJson text. A Feature object will always have a "type" member with the value "Feature".

A Feature object has a member with the name "geometry". The value of the geometry member SHALL be either a Geometry object or, in the case that the Feature is unlocated, a JSON null value.

A Feature object has a member with the name "properties". The value of the properties member is an object (any JSON object or a JSON null value).

 {
   "type": "Feature",
   "geometry": {
     "type": "Point",
     "coordinates": [102.0, 0.5]
   },
   "properties": {
     "prop0": "value0"
   }
  }

FeatureCollection

This represents a GeoJson Feature Collection which holds a list of Feature objects (when serialized the feature list becomes a JSON array).

Note that the feature list could potentially be empty. Features within the list must follow the specifications defined inside the Feature class.

 {
   "type": "FeatureCollection",
   "bbox": [100.0, 0.0, -100.0, 105.0, 1.0, 0.0],
   "features": [
     //...
   ]
 }

GeoJSON

GeoJSON is a format for encoding a variety of geographic data structures.

Geometry

Each of the six geometries and GeometryCollection which make up GeoJson implement this interface. See glossary below.

Linear Ring

  • A linear ring is a closed LineString with four or more coordinates.

  • The first and last coordinates are equivalent, and they MUST contain identical values; their representation SHOULD also be identical.

  • A linear ring is the boundary of a surface or the boundary of a hole in a surface.

  • A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.

Position

A Position is the fundamental geometry construct. The "coordinates" member of a Geometry object is composed of either:

  • one position in the case of a Point geometry,

  • an array of positions in the case of a LineString or MultiPoint geometry,

  • an array of LineString, or linear ring coordinates in the case of a Polygon or MultiLineString geometry, or

  • an array of Polygon coordinates in the case of a MultiPolygon geometry.

A Position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element.

 [-100.0, 62.5, 3245.0]
 [
  longitude (column/x-coord), 
  latitude (row/y-coord), 
  altitude/elevation (meters)
 ]

Third element is optional.

Geometry Objects

The following are the 7 geometries found in the GeoJSON spec.

Term

Definition

Example

GeometryCollection

A GeometryCollection has a member with the name "geometries". The value of "geometries" is a List. Each element of this list is a GeoJson Geometry object. It is possible for this list to be empty.

Unlike the other geometry types, a GeometryCollection can be a heterogeneous composition of smaller Geometry objects. For example, a Geometry object in the shape of a lowercase roman "i" can be composed of one Point and one LineString.

GeometryCollections have a different syntax from single TYPE Geometry objects (Point, LineString, and Polygon) and homogeneously typed multipart Geometry objects (MultiPoint, MultiLineString, or MultiPolygon) but have no different semantics. Although a GeometryCollection object has no "coordinates" member, it does have coordinates: the coordinates of all its parts belong to the collection. The "geometries" member of a GeometryCollection describes the parts of this composition. Implementations SHOULD NOT apply any additional semantics to the "geometries" array.

To maximize interoperability, implementations SHOULD avoid nested GeometryCollections. Furthermore, GeometryCollections composed of a single part or a number of parts of a single TYPE SHOULD be avoided when that single part or a single object of multipart TYPE (MultiPoint, MultiLineString, or MultiPolygon) could be used instead.

{
   "type": "GeometryCollection",
   "geometries": [{
     "type": "Point",
     "coordinates": [100.0, 0.0]
   }, {
     "type": "LineString",
     "coordinates": [
       [101.0, 0.0],
       [102.0, 1.0]
     ]
   }]
 }

LineString

A LineString represents two or more geographic Points that share a relationship.

 {
   "type": "LineString",
   "coordinates": [
     [100.0, 0.0],
     [101.0, 1.0]
   ]
 }

MultiLineString

A MultiLineString is an array of LineString coordinate arrays.

{
   "type": "MultiLineString",
   "coordinates": [
     [
       [100.0, 0.0],
       [101.0, 1.0]
     ],
     [
       [102.0, 2.0],
       [103.0, 3.0]
     ]
   ]
 }

MultiPoint

A MultiPoint represents two or more geographic Points that share a relationship.

This adheres to the RFC 7946 internet standard when serialized into JSON. When deserialized, this class becomes an immutable object which should be initiated using its static factory methods. The list of points must be equal to or greater than 2.

{
   "type": "MultiPoint",
   "coordinates": [
     [100.0, 0.0],
     [101.0, 1.0]
   ]
 }

MultiPolygon

A MultiPolygon is an array of Polygon coordinate arrays.

This adheres to the RFC 7946 internet standard when serialized into JSON. When deserialized, this class becomes an immutable object which should be initiated using its static factory methods.

 {
   "type": "MultiPolygon",
   "coordinates": [
     [
       [
         [102.0, 2.0],
         [103.0, 2.0],
         [103.0, 3.0],
         [102.0, 3.0],
         [102.0, 2.0]
       ]
     ],
     [
       [
         [100.0, 0.0],
         [101.0, 0.0],
         [101.0, 1.0],
         [100.0, 1.0],
         [100.0, 0.0]
       ],
       [
         [100.2, 0.2],
         [100.2, 0.8],
         [100.8, 0.8],
         [100.8, 0.2],
         [100.2, 0.2]
       ]
     ]
   ]
 }

Point

A Point represents a single geographic position in terms of decimal latitude and longitude.

{
   "type": "Point",
   "coordinates": [100.0, 0.0]
 }

Polygon

This class represents a GeoJson Polygon which may or may not include polygon holes.

To specify a constraint specific to Polygons, it is useful to introduce the concept of a linear ring:

  • A linear ring is a closed LineString with four or more coordinates.

  • The first and last coordinates are equivalent, and they MUST contain identical values; their representation SHOULD also be identical.

  • A linear ring is the boundary of a surface or the boundary of a hole in a surface.

  • A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.

Note that most of the rules listed above are checked when a Polygon instance is created (the exception being the last rule). If one of the rules is broken, a RuntimeException will occur.

Though a linear ring is not explicitly represented as a GeoJson geometry TYPE, it leads to a canonical formulation of the Polygon geometry TYPE. When initializing a new instance of this class, a LineString for the outer and optionally an inner are checked to ensure a valid linear ring.

 {
   "type": "Polygon",
   "coordinates": [
     [
      [100.0, 0.0],
      [101.0, 0.0],
      [101.0, 1.0],
      [100.0, 1.0],
      [100.0, 0.0]
     ]
   ]
 }