Each of the examples below represents a valid and complete GeoJSON object.
Point coordinates are in x, y order (easting, northing for projected coordinates, longitude, latitude for geographic coordinates):
{
"type": "Point",
"coordinates": [100.0, 0.0]
}
Coordinates of LineString are an array of positions (see ):
{
"type": "LineString",
"coordinates": [
[100.0, 0.0],
[101.0, 1.0]
]
}
Coordinates of a Polygon are an array of LinearRing (see ) coordinate arrays. The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).
No holes:
{
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0]
]
]
}
With holes:
{
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0]
],
[
[100.8, 0.8],
[100.8, 0.2],
[100.2, 0.2],
[100.2, 0.8],
[100.8, 0.8]
]
]
}
Coordinates of a MultiPoint are an array of positions::
{
"type": "MultiPoint",
"coordinates": [
[100.0, 0.0],
[101.0, 1.0]
]
}
Coordinates of a MultiLineString are 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]
]
]
}
Coordinates of a MultiPolygon are an array of Polygon coordinate arrays:
{
"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]
]
]
]
}
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above:
{
"type": "GeometryCollection",
"geometries": [{
"type": "Point",
"coordinates": [100.0, 0.0]
}, {
"type": "LineString",
"coordinates": [
[101.0, 0.0],
[102.0, 1.0]
]
}]
}
This appendix briefly summarizes non-editorial changes from the 2008 specification [GJ2008].
-
Specification of coordinate reference systems has been removed, i.e., the "crs" member of [GJ2008] is no longer used.
-
In the absence of elevation values, applications sensitive to height or depth SHOULD interpret positions as being at local ground or sea level (see ).
-
Implementations SHOULD NOT extend position arrays beyond 3 elements (see ).
-
A line between two positions is a straight Cartesian line (see ).
-
Polygon rings MUST follow the right-hand rule for orientation (counter-clockwise external rings, clockwise internal rings).
-
The values of a "bbox" array are "[west, south, east, north]", not "[minx, miny, maxx, maxy]" (see ).
-
A Feature object's "id" member is a string or number (see ).
-
Extensions MAY be used, but MUST NOT change the semantics of GeoJSON members and types (see ).
-
GeoJSON objects MUST NOT contain the defining members of other types (see ).
-
The media type for GeoJSON is application/geo+json.
-
The definition of a GeoJSON text has been added.
-
Rules for mapping 'geo' URIs have been added.
-
A recommendation of the I-JSON [RFC7493] constraints has been added.
-
Implementers are cautioned about the effect of excessive coordinate precision on interoperability.
-
Interoperability concerns of geometry collections are noted. These objects should be used sparingly (see ).
All GeoJSON objects defined in this specification - FeatureCollection, Feature, and Geometry - consist of exactly one JSON object. However, there may be circumstances in which applications need to represent sets or sequences of these objects (over and above the grouping of Feature objects in a FeatureCollection), e.g. in order to efficiently "stream" large numbers of Feature objects. The definition of such sets or sequences is outside the scope of this specification.
If such a representation is needed, a new media type is required that has the ability to represent these sets or sequences. When defining such a media type, it may be useful to base it on "JSON Text Sequences" [RFC7464], leaving the foundations of how to represent multiple JSON objects to that specification, and only defining how it applies to GeoJSON objects.