http://wiki.geojson.org/api.php?action=feedcontributions&user=Tschaub&feedformat=atomGeoJSON - User contributions [en]2020-08-12T12:57:14ZUser contributionsMediaWiki 1.26.3http://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=182GeoJSON draft version 52008-03-07T18:03:42Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y order (or longitude, latitude for coordinates in decimal degrees). Any number of additional dimensions are allowed, and interpretation and meaning of these coordinates is beyond the scope of this specification.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object (referred to as the CRS object below). This object must have at least two named members: "type" and "properties". It may have an additional named member named "coordinate_order".<br />
### The value of the member named "type" must be a string.<br />
### The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
#### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case. If the CRS object represents a coordinate reference system that defines a different coordinate order than GeoJSON (x, y, with optional additional dimensions), then the CRS object must include a member named "coordinate_order" - see point below about coordinate_order.<br />
#### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
##### The value of the "type" member must be "OGC".<br />
##### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
##### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
##### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
#### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
##### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
##### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
##### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
### If included, the value of the "coordinate_order" member is an array (referred to as the coordinate_order array). The number of values in the coordinate_order array must be equal to the number of items in the coordinate arrays within children of the parent of the CRS object. This array defines a mapping from CRS coordinate ordering to GeoJSON ordering (which must be x, y, and may have optional additional dimensions). Not including a member named "coodinate_order" is equivalent to including the following: <code>"coordinate_order": [0, 1]</code>.<br />
#### The CRS object must include a coordinate_order member if the CRS-defined axes order is not lon, lat (for a geographic crs) or easting, northing (for a projected crs). For example, data that references EPSG:4326 for its CRS would require a CRS object like so: <code>"crs": {"type": "EPSG", "properties": {"code": 4326}, "coordinate_order": [1, 0]}</code><br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
Example of a bbox member on a polygon geometry<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
Example of a bbox member on a feature collection (with a bbox on each feature as well)<br />
{<br />
"type": "FeatureCollection",<br />
"bbox": [100, 0, 105, 1],<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"bbox": [102, 0, 105, 1],<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"bbox": [100, 0, 101, 1],<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=181GeoJSON draft version 52008-03-07T18:01:25Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y order (or longitude, latitude for coordinates in decimal degrees). Any number of additional dimensions are allowed, and interpretation and meaning of these coordinates is beyond the scope of this specification.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object (referred to as the CRS object below). This object must have at least two named members: "type" and "properties". It may have an additional named member named "coordinate_order".<br />
### The value of the member named "type" must be a string.<br />
### The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
#### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case. If the CRS object represents a coordinate reference system that defines a different coordinate order than GeoJSON (x, y, with optional additional dimensions), then the CRS object must include a member named "coordinate_order" - see point below about coordinate_order.<br />
#### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
##### The value of the "type" member must be "OGC".<br />
##### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
##### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
##### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
#### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
##### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
##### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
##### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
### If included, the value of the "coordinate_order" member is an array (referred to as the coordinate_order array). The number of values in the coordinate_order array must be equal to the number of items in the coordinate arrays within children of the parent of the CRS object. This array defines a mapping from CRS coordinate ordering to GeoJSON ordering (which must be x, y, and may have optional additional dimensions). If it is not defined, the default coordinate_order, [0, 1], is assumed.<br />
#### The CRS object must include a coordinate_order member if the CRS-defined axes order is not lon, lat (for a geographic crs) or easting, northing (for a projected crs). For example, data that references EPSG:4326 for its CRS would require a CRS object like so: <code>"crs": {"type": "EPSG", "properties": {"code": 4326}, "coordinate_order": [1, 0]}</code><br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
Example of a bbox member on a polygon geometry<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
Example of a bbox member on a feature collection (with a bbox on each feature as well)<br />
{<br />
"type": "FeatureCollection",<br />
"bbox": [100, 0, 105, 1],<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"bbox": [102, 0, 105, 1],<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"bbox": [100, 0, 101, 1],<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=180GeoJSON draft version 52008-03-07T17:56:59Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y order (or longitude, latitude for coordinates in decimal degrees). Any number of additional dimensions are allowed, and interpretation and meaning of these coordinates is beyond the scope of this specification.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object (referred to as the CRS object below). This object must have at least two named members: "type" and "properties". It may have an additional named member named "coordinate_order".<br />
### The value of the member named "type" must be a string.<br />
### The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
#### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
#### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
##### The value of the "type" member must be "OGC".<br />
##### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
##### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
##### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
#### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
##### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
##### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
##### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
### If included, the value of the "coordinate_order" member is an array (referred to as the coordinate_order array). The number of values in the coordinate_order array must be equal to the number of items in the coordinate arrays within children of the parent of the CRS object. This array defines a mapping from CRS coordinate ordering to GeoJSON ordering (which must be x, y, and may have optional additional dimensions). If it is not defined, the default coordinate_order, [0, 1], is assumed.<br />
#### The CRS object must include a coordinate_order member if the CRS-defined axes order is not lon, lat (for a geographic crs) or easting, northing (for a projected crs). For example, data that references EPSG:4326 for its CRS would require a CRS object like so: <code>"crs": {"type": "EPSG", "properties": {"code": 4326}, "coordinate_order": [1, 0]}</code><br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
Example of a bbox member on a polygon geometry<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
Example of a bbox member on a feature collection (with a bbox on each feature as well)<br />
{<br />
"type": "FeatureCollection",<br />
"bbox": [100, 0, 105, 1],<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"bbox": [102, 0, 105, 1],<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"bbox": [100, 0, 101, 1],<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=179GeoJSON draft version 52008-03-07T17:53:32Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y order (or longitude, latitude for coordinates in decimal degrees). Any number of additional dimensions are allowed, and interpretation and meaning of these coordinates is beyond the scope of this specification.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object (referred to as the CRS object below). This object must have at least two named members: "type" and "properties". It may have an additional named member named "coordinate_order".<br />
### If included, the value of the "coordinate_order" member is an array (referred to as the coordinate_order array). The number of values in the coordinate_order array must be equal to the number of items in the coordinate arrays within children of the parent of the CRS object. This array defines a mapping from CRS coordinate ordering to GeoJSON ordering (which must be x, y, and may have optional additional dimensions). If it is not defined, the default coordinate_order, [0, 1], is assumed.<br />
### The value of the member named "type" must be a string.<br />
### The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
#### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
##### The CRS object must include a coordinate_order member if the CRS-defined axes order is not lon, lat (for a geographic crs) or easting, northing (for a projected crs). For example, data that references EPSG:4326 for its CRS would require a CRS object like so: <code>"crs": {"type": "EPSG", "properties": {"code": 4326}, "coordinate_order": [1, 0]}</code><br />
#### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
##### The value of the "type" member must be "OGC".<br />
##### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
##### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
##### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
#### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
##### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
##### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
##### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
Example of a bbox member on a polygon geometry<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
Example of a bbox member on a feature collection (with a bbox on each feature as well)<br />
{<br />
"type": "FeatureCollection",<br />
"bbox": [100, 0, 105, 1],<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"bbox": [102, 0, 105, 1],<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"bbox": [100, 0, 101, 1],<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=178GeoJSON draft version 52008-03-07T17:49:27Z<p>Tschaub: language tweaks</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y order (or longitude, latitude for coordinates in decimal degrees). Any number of additional dimensions are allowed, and interpretation and meaning of these coordinates is beyond the scope of this specification.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object (referred to as the CRS object below). This object must have at least two named members: "type" and "properties". It may have an additional named member named "coordinate_order".<br />
### If included, the value of the "coordinate_order" member is an array (referred to as the coordinate_order array). The number of values in the coordinate_order array must be equal to the number of items in the coordinate arrays within children of the parent of the CRS object. This array defines a mapping from CRS coordinate ordering to GeoJSON ordering (which must be x, y, and may have optional additional dimensions). If it is not defined, the default coordinate_order, [0, 1], is assumed.<br />
### The value of the member named "type" must be a string.<br />
### The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
#### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
##### The CRS object must include a coordinate_order member if the CRS-defined axes order is not lon, lat (for a geographic crs) or easting, northing (for a projected crs). For example, data that references EPSG:4326 for its CRS data would require a CRS object like so: <code>"crs": {"type": "EPSG", "properties": {"code": 4326}, "coordinate_order": [1, 0]}</code><br />
#### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
##### The value of the "type" member must be "OGC".<br />
##### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
##### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
##### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
#### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
##### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
##### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
##### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
Example of a bbox member on a polygon geometry<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
Example of a bbox member on a feature collection (with a bbox on each feature as well)<br />
{<br />
"type": "FeatureCollection",<br />
"bbox": [100, 0, 105, 1],<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"bbox": [102, 0, 105, 1],<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"bbox": [100, 0, 101, 1],<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=176GeoJSON draft version 52008-03-07T17:35:00Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y order (or longitude, latitude for coordinates in decimal degrees): optional additional dimensions are allowed, and interpretation and meaning of these coordinates is beyond the scope of this specification.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". It may have one additional named member: "coordinate_order".<br />
### If defined, coordinate_order is an array, with a number of values equal to the number of coordinates in coordinate arrays within children of the parent of the CRS object. This array defines a mapping from CRS coordinate ordering to GeoJSON ordering (which must be x, y, and may have optional additional dimensions). If it is not defined, the default coordinate_order, [0, 1], is assumed.<br />
### The value of the member named "type" must be a string. <br />
### The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
#### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
#### The CRS object must define a coordinate_order property if the CRS-defined axes order is not lon, lat (for a geographic crs) or easting, northing (for a projected crs). For example, EPSG:4326 data would require a crs object like so: <code>"crs": {"type": "EPSG", "properties": {"code": 4326}, "coordinate_order": [1, 0]}</code><br />
#### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
##### The "type" member must be "OGC".<br />
##### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
##### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
##### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
#### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
##### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
##### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
##### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
Example of a bbox member on a polygon geometry<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
Example of a bbox member on a feature collection (with a bbox on each feature as well)<br />
{<br />
"type": "FeatureCollection",<br />
"bbox": [100, 0, 105, 1],<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"bbox": [102, 0, 105, 1],<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"bbox": [100, 0, 101, 1],<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=171GeoJSON draft version 52007-11-12T22:17:45Z<p>Tschaub: adding some more bbox examples</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
#### EPSG codes must not be used if 1) the EPSG-defined axes order of the crs is not lon, lat (for a geographic crs) or easting, northing (for a projected crs), or 2) the EPSG-defined coordinate representation of a geographic crs is not decimal degrees (e.g. if is degrees/minutes/seconds). Instead, such data should use OGC URNs that specify the ordering to be lon, lat (or easting, northing) and/or the coordinate representation to be decimal degrees.<br />
### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
#### The "type" member must be "OGC".<br />
#### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
#### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
#### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
#### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
#### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
#### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
Example of a bbox member on a polygon geometry<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
Example of a bbox member on a feature collection (with a bbox on each feature as well)<br />
{<br />
"type": "FeatureCollection",<br />
"bbox": [100, 0, 105, 1],<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"bbox": [102, 0, 105, 1],<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"bbox": [100, 0, 101, 1],<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=170GeoJSON draft version 52007-11-12T22:11:06Z<p>Tschaub: /* Including Bounding Box/Envelope */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
#### EPSG codes must not be used if 1) the EPSG-defined axes order of the crs is not lon, lat (for a geographic crs) or easting, northing (for a projected crs), or 2) the EPSG-defined coordinate representation of a geographic crs is not decimal degrees (e.g. if is degrees/minutes/seconds). Instead, such data should use OGC URNs that specify the ordering to be lon, lat (or easting, northing) and/or the coordinate representation to be decimal degrees.<br />
### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
#### The "type" member must be "OGC".<br />
#### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
#### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
#### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
#### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
#### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
#### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 10], [20, 90], [180, -5], [-30, -90] ]<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=Main_Page&diff=169Main Page2007-11-12T22:02:41Z<p>Tschaub: /* Draft Specification */</p>
<hr />
<div>== Draft Specification ==<br />
<br />
*[[GeoJSON_draft_version_5]]<br />
<br />
== GeoJSON ==<br />
<br />
* [[What_is_JSON%3F|What is JSON?]]<br />
* [[What_is_GeoJSON%3F|What is GeoJSON?]]<br />
<br />
== Example Implementations ==<br />
<br />
* [http://dev.openlayers.org/sandbox/tschaub/geojson/examples/geojson.html GeoJSON in OpenLayers]<br />
* [http://docs.codehaus.org/display/GEOSDOC/GeoJSON+Output+Format GeoJSON plug-in for GeoServer]<br />
* [http://exportgge.sourceforge.net/kml/ GeoJSON plug-in for CartoWeb]<br />
<br />
== Discussion list ==<br />
<br />
* [http://lists.geojson.org/listinfo.cgi/geojson-geojson.org http://lists.geojson.org/listinfo.cgi/geojson-geojson.org]<br />
<br />
== IRC ==<br />
<br />
* [irc://irc.freenode.net/#geojson #geojson] channel on irc.freenode.net<br />
<br />
== Draft History ==<br />
<br />
*[[RFC-001]] (Deprecated)<br />
*[[RFC-2]] (Moved to [[GeoJSON_1.0_RC_1]] )<br />
<br />
== Other ==<br />
* [[URL_Encoded_Data|URL Encoded Data (UED)]]<br />
* [http://www.geonames.org/export/JSON-webservices.html Geonames JSON Webservices]<br />
* [http://www.google.com/apis/maps/documentation/#Geocoding_Structured Google's Geocoder JSON Response]</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=168GeoJSON draft version 52007-11-12T21:56:20Z<p>Tschaub: adding suggested format for bbox</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. <br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection". The case of the type member values must be as shown here.<br />
### A GeoJSON geometry object of any type other than "GeometryCollection" must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".<br />
### A GeoJSON geometry object with type "GeometryCollection" is a geometry object which represents a collection of geometry objects.<br />
#### A geometry collection must have a member with the name "geometries". The value corresponding to "geometries" is an array. Each element in this array is a GeoJSON geometry object.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value (as in <code>{"type":"Feature", "properties": {"title":"empty"}, "geometry":null}</code>).<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a geographic coordinate reference system, using the WGS84 datum, and with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 2805}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
#### EPSG codes must not be used if 1) the EPSG-defined axes order of the crs is not lon, lat (for a geographic crs) or easting, northing (for a projected crs), or 2) the EPSG-defined coordinate representation of a geographic crs is not decimal degrees (e.g. if is degrees/minutes/seconds). Instead, such data should use OGC URNs that specify the ordering to be lon, lat (or easting, northing) and/or the coordinate representation to be decimal degrees.<br />
### To use an OGC URN (http://portal.opengeospatial.org/files/?artifact_id=16339) as a unique identifier of a coordinate reference system, the "crs" member should have the following structure:<br />
#### The "type" member must be "OGC".<br />
#### The properties member must be an object with one member, "urn", that specifies an OGC URN such as "urn:ogc:def:crs:OGC:1.3:CRS84".<br />
#### The URN "urn:ogc:def:crs:OGC:1.3:CRS84" should be used in place of EPSG:4326 to indicate decimal degrees using the WGS84 datum in lon, lat order: the CRS object in this case would look like: <code>{"type":"OGC", "properties": {"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}</code><br />
#### Unless your data falls under one of the exceptions above, you should prefer EPSG codes to OGC URNs.<br />
### To use a URL as a unique identifier to a coordinate reference system, the "crs" member should have the following structure: <br />
#### The properties object should contain one member: "url", that specifies a URL for the spatial reference that can be dereferenced by the client. <br />
#### An optional member, "type", is recommended, specifying the type of information available at the URL. This may be any string: suggestions are "proj4", "ogcwkt", "esriwkt", though others can be used. Applications may use this "type" member to determine the type of information that is available at the URL.<br />
#### The specification does not offer any information on how to convert this URL into a spatial reference system: use is intended to provide users the ability to define their references outside the EPSG namespace *only*.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== GeometryCollection ====<br />
Each element in the geometries array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
<br />
Since a GeometryCollection is a geometry type, you can use one inside a Feature:<br />
<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the features array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "URL",<br />
"properties": { <br />
"url": "http://spatialreference.org/ref/epsg/2001/proj4/",<br />
"type": "proj4"<br />
}<br />
},<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
=== Including Bounding Box/Envelope ===<br />
<br />
To include information on the coordinate range for geometries, features, or feature collections, it is suggested that member named bbox be included in a GeoJSON object. The value of the bbox member should be a 2*n item array where n is the number of dimensions represented in the contained geometries and lowest values for all axes are followed by highest values. Axes order of a bbox follows axes order of geometries. In addition, the spatial reference for the bbox is assumed to match the spatial reference for the GeoJSON object of which it is a member.<br />
<br />
{ <br />
"bbox": [-180, -90, 180, 90],<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [-180, 0], [0, 90], [180, 0], [0, -90] ]<br />
]<br />
}<br />
<br />
=== Using with non-geographic elements === <br />
GeoJSON is not a format in itself, but a specification for adding geometry to JSON elements. Therefore, it is possible to GeoJSON within a broader JSON document that has mixed elements - for example a blog.<br />
<br />
{<br />
"blog" : {<br />
"posts" : [<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 1",<br />
"atom:description" : "i love blogging"},<br />
{<br />
"type" : "atom:item",<br />
"atom:summary": "post 2 from CA",<br />
"atom:description" : "geoblogging in California"<br />
"location" : {<br />
"type", "Point",<br />
"coordinates": [-120, 40]<br />
}<br />
},<br />
],<br />
"location" : {<br />
"type", "Polygon",<br />
"coordinates": [[[-121, 39], [-119, 39], [-119, 41], [-121, 41], [-121, 39]]]<br />
}<br />
}<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Martin Daly<br />
* Christopher Schmidt<br />
* Sean Gillies<br />
* Andrew Turner</div>Tschaubhttp://wiki.geojson.org/index.php?title=Main_Page&diff=154Main Page2007-10-04T21:09:02Z<p>Tschaub: updating link to draft</p>
<hr />
<div>== Draft Specification ==<br />
<br />
*[[GeoJSON_draft_version_4]]<br />
<br />
== GeoJSON ==<br />
<br />
* [[What_is_JSON%3F|What is JSON?]]<br />
* [[What_is_GeoJSON%3F|What is GeoJSON?]]<br />
<br />
== Example Implementations ==<br />
<br />
* [http://dev.openlayers.org/sandbox/tschaub/geojson/examples/geojson.html GeoJSON in OpenLayers]<br />
* [http://docs.codehaus.org/display/GEOSDOC/GeoJSON+Output+Format GeoJSON plug-in for GeoServer]<br />
<br />
== Discussion list ==<br />
<br />
* [http://lists.geojson.org/listinfo.cgi/geojson-geojson.org http://lists.geojson.org/listinfo.cgi/geojson-geojson.org]<br />
<br />
== IRC ==<br />
<br />
* [irc://irc.freenode.net/#geojson #geojson] channel on irc.freenode.net<br />
<br />
== Draft History ==<br />
<br />
*[[RFC-001]] (Deprecated)<br />
*[[RFC-2]] (Moved to [[GeoJSON_1.0_RC_1]] )<br />
<br />
== Other ==<br />
* [[URL_Encoded_Data|URL Encoded Data (UED)]]<br />
* [http://www.geonames.org/export/JSON-webservices.html Geonames JSON Webservices]<br />
* [http://www.google.com/apis/maps/documentation/#Geocoding_Structured Google's Geocoder JSON Response]</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=131GeoJSON draft version 52007-07-10T00:14:41Z<p>Tschaub: clarifying the additional members section so that people who don't care about namespaces don't think that the only thing you can add</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box". The case of the type member values must be as shown here.<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geometry objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 4267}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
### The use of a "crs" member for EPSG:4326 is discouraged since the default of not having a "crs" member would result in the same coordinate values.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
Coordinates of a Box are an array of two Point coordinates. The first element in the array represents the minimum corner point (minx, miny). The second element in the array represents the maximum corner point (maxx, maxy).<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
Each element in the members array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the members array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4267}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Sean Gillies<br />
* Martin Daly</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_1.0_RC_1&diff=128GeoJSON 1.0 RC 12007-07-05T16:36:50Z<p>Tschaub: clarifying the additional members section so that people who don't care about namespaces don't think that the only thing you can add</p>
<hr />
<div>Moved to: [[GeoJSON draft version 2]]<br />
<br />
<br />
== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box". The case of the type member values must be as shown here.<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geometry objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: <code>"crs": {"type": "EPSG", "properties": {"code": 4267}}</code>. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
### The use of a "crs" member for EPSG:4326 is discouraged since the default of not having a "crs" member would result in the same coordinate values.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
Coordinates of a Box are an array of two Point coordinates. The first element in the array represents the minimum corner point (minx, miny). The second element in the array represents the maximum corner point (maxx, maxy).<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
Each element in the members array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the members array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4267}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON allows additional members at any level in a GeoJSON object (as described in point 2 in the specification). <br />
<br />
For example, if you are constructing a Feature type object, three members are required (named "type", "geometry", and "properties"). In addition to these three members, you may add any additional members. The example below adds a member named "foo" with the value "bar".<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
},<br />
"foo": "bar"<br />
}<br />
<br />
If you are working with a data standard that uses namespaces, you can handle those by taking advantage of these extra members. For example, adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Sean Gillies<br />
* Martin Daly</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=122GeoJSON draft version 52007-06-01T18:51:32Z<p>Tschaub: /* Including additional properties */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box". The case of the type member values must be as shown here.<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geometry objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4267}}. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
### The use of a "crs" member for EPSG:4326 is discouraged since the default of not having a "crs" member would result in the same coordinate values.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
Coordinates of a Box are an array of two Point coordinates. The first element in the array represents the minimum corner point (minx, miny). The second element in the array represents the maximum corner point (maxx, maxy).<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
Each element in the members array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the members array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4267}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional members ===<br />
GeoJSON also allows additional members at the top level of each GeoJSON object. Adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Sean Gillies<br />
* Martin Daly</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=121GeoJSON draft version 52007-06-01T18:48:24Z<p>Tschaub: removing language about requirements on parsers</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection". "type" must be lower case, the case of the type member values must be as shown here.<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box". The case of the type member values must be as shown here.<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geometry objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees. A GeoJSON object may have a member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4267}}. "crs", "type", and "properties" must be lower case. When used as a value, "EPSG" must be upper case.<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
### The use of a "crs" member for EPSG:4326 is discouraged since the default of not having a "crs" member would result in the same coordinate values.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
Coordinates of a Box are an array of two Point coordinates. The first element in the array represents the minimum corner point (minx, miny). The second element in the array represents the maximum corner point (maxx, maxy).<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
Each element in the members array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the members array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4267}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
=== Including additional properties ===<br />
GeoJSON also allows additional properties at the top level of each GeoJSON object. Adding a member with the name "@namespaces" is valid in GeoJSON:<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#"},<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
Additionally, since all unicode characters are allowed in member names, the following object (with a member named "atom:summary" is valid GeoJSON).<br />
<br />
{<br />
"@namespaces": {"":"http://geojson.org/ns#", "atom":"http://www.w3.org/2005/Atom"},<br />
"@type": "atom:item",<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"atom:summary": "Some GeoJSON Content",<br />
"atom:description": "This content is also valid GeoJDIL."<br />
}<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Sean Gillies<br />
* Martin Daly</div>Tschaubhttp://wiki.geojson.org/index.php?title=Main_Page&diff=113Main Page2007-05-30T20:20:03Z<p>Tschaub: adding section for links to implementations</p>
<hr />
<div>== GeoJSON ==<br />
<br />
* [[What_is_JSON%3F|What is JSON?]]<br />
* [[What_is_GeoJSON%3F|What is GeoJSON?]]<br />
<br />
== Specification ==<br />
*[[GeoJSON_1.0_RC_1]] - Release Candidate 1 for GeoJSON 1.0<br />
<br />
== Example Implementations ==<br />
* [http://dev.openlayers.org/sandbox/tschaub/geojson/examples/geojson.html GeoJSON in OpenLayers]<br />
<br />
== RFCs ==<br />
*[[RFC-001]] (Deprecated)<br />
*[[RFC-2]] (Moved to [[GeoJSON_1.0_RC_1]] )<br />
<br />
== Other ==<br />
* [[URL_Encoded_Data|URL Encoded Data (UED)]]<br />
* [http://www.geonames.org/export/JSON-webservices.html Geonames JSON Webservices]<br />
* [http://www.google.com/apis/maps/documentation/#Geocoding_Structured Google's Geocoder JSON Response]<br />
<br />
== Discussion list ==<br />
<br />
* [http://lists.geojson.org/listinfo.cgi/geojson-geojson.org http://lists.geojson.org/listinfo.cgi/geojson-geojson.org]<br />
<br />
== IRC ==<br />
<br />
* [irc://irc.freenode.net/#geojson #geojson] channel on irc.freenode.net</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=102GeoJSON draft version 52007-05-26T06:27:28Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
Coordinates of a Box are an array of two Point coordinates. The first element in the array represents the minimum corner point (minx, miny). The second element in the array represents the maximum corner point (maxx, maxy).<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
Each element in the members array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the members array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
==Authors==<br />
* Tim Schaub<br />
* Allan Doyle<br />
* Sean Gillies<br />
* Martin Daly</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=98GeoJSON draft version 52007-05-24T18:39:55Z<p>Tschaub: /* Examples */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
Point coordinates are in x, y order (longitude, latitude for geographic coordinates).<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
Coordinates of LineString are an array of Point coordinates.<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
Coordinates of a Polygon are an array of LinearRing coordinates (LineString coordinates where the first and last points are equivalent). The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).<br />
<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
Coordinates of a MultiPoint are an array of Point coordinates.<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
Coordinates of a MultiLineString are an array of LineString coordinates.<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
Coordinates of a MultiPolygon are an array of Polygon coordinates.<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
Coordinates of a Box are an array of two Point coordinates. The first element in the array represents the minimum corner point (minx, miny). The second element in the array represents the maximum corner point (maxx, maxy).<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
Each element in the members array of a GeometryCollection is one of the geometry objects described above.<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
A Feature is an object with a geometry and additional properties.<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
Each element in the members array of a FeatureCollection is a Feature object as described above.<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=97GeoJSON draft version 52007-05-24T17:46:03Z<p>Tschaub: </p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=96GeoJSON draft version 52007-05-24T17:44:45Z<p>Tschaub: </p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 1.0] ],<br />
[ [102.0, 2.0], [103.0, 3.0] ]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=95GeoJSON draft version 52007-05-24T17:43:19Z<p>Tschaub: /* Polygon */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=94GeoJSON draft version 52007-05-24T17:42:24Z<p>Tschaub: /* MultiPolygon */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]<br />
],<br />
[<br />
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],<br />
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=93GeoJSON draft version 52007-05-24T17:06:13Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object. This object must have at least two named members: "type" and "properties". The value of the member named "type" must be a string. The value of the member named "properties" must be an object. This specification defines no further requirements for the structure of these objects. Instead, a convention is offered.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=92GeoJSON draft version 52007-05-24T16:58:55Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries. Clients may assume that a GeoJSON data structure without a member named "crs" contains geometries in a Geographic projection, in the WGS84 datum, with units in decimal degrees.<br />
## The value of a member named "crs" must be an object.<br />
## This specification defines no requirements for the structure of this object, but offers a convention instead.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=91GeoJSON draft version 52007-05-24T16:33:50Z<p>Tschaub: </p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
# A GeoJSON object may have an member with the name "crs". If a GeoJSON object has a member named "crs", it is assumed to represent the coordinate reference system of the included geometry or geometries. If a GeoJSON object does not have a member named "crs", it is assumed that the server and client have a mutual understanding about the coordinate reference system of the included geometries.<br />
## The value of a member named "crs" must be an object.<br />
## This specification defines no requirements for the structure of this object, but offers a convention instead.<br />
### To use EPSG codes to describe coordinate reference system, the "crs" member should have the following structure: "crs": {"type": "EPSG", "properties": {"code": 4326}}<br />
### Note that the use of EPSG codes does not change the meaning of the coordinate order for a GeoJSON data structure. All coordinates in GeoJSON are in x, y order (longitude, latitude). This is true regardless of the schema used to represent the coordinate reference system.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}<br />
<br />
Same feature collection, with a member named "crs" to represent the coordinate reference system.<br />
{<br />
"type": "FeatureCollection",<br />
"crs": {<br />
"type": "EPSG",<br />
"properties": {"code": 4326}<br />
},<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=90GeoJSON draft version 52007-05-24T14:56:26Z<p>Tschaub: </p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must two elements. Each element in the coordinates array is a coordinates array as described for type "Point". The first element in the array represents the minx, miny corner of the box, and the second point represents the maxx, maxy corner of the box.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [[100.0, 0.0], [101.0, 1.0]]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=89GeoJSON draft version 52007-05-23T23:45:02Z<p>Tschaub: /* FeatureCollection */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=88GeoJSON draft version 52007-05-23T23:22:08Z<p>Tschaub: /* GeometryCollection */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[101.0, 0.0], [102.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=87GeoJSON draft version 52007-05-23T23:17:16Z<p>Tschaub: /* Feature */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=86GeoJSON draft version 52007-05-23T23:16:35Z<p>Tschaub: /* Feature */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=85GeoJSON draft version 52007-05-23T23:15:10Z<p>Tschaub: /* FeatureCollection */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=84GeoJSON draft version 52007-05-23T23:13:46Z<p>Tschaub: /* FeatureCollection */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=83GeoJSON draft version 52007-05-23T23:11:46Z<p>Tschaub: /* FeatureCollection */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 2.0], [101.0, 3.0]<br />
]<br />
},<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=82GeoJSON draft version 52007-05-23T23:08:02Z<p>Tschaub: </p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that while the term ''member'' generally refers to a name/value pair, GeoJSON does use the name "members" in geometry collections and feature collections.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "members" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "members". The value corresponding to "members" is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "members" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"members": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"members": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 2.0], [101.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=81GeoJSON draft version 52007-05-23T22:45:18Z<p>Tschaub: /* MultiPolygon */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "MultiPolygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 2.0], [101.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=80GeoJSON draft version 52007-05-23T21:46:15Z<p>Tschaub: /* Box */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [100.0, 0.0, 101.0, 1.0]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 2.0], [101.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=79GeoJSON draft version 52007-05-23T21:41:40Z<p>Tschaub: </p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or longitude, latitude, elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", the coordinates array must have exactly four elements. The elements in the coordinates array are values corresponding to minx, miny, maxx, and maxy (or minimum longitude, minimum latitude, maximum longitude, maximum latitude).<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[100.0, 0.0, 101.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 2.0], [101.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=78GeoJSON draft version 52007-05-23T21:32:20Z<p>Tschaub: </p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or Longitude, Latitude, Elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array must not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 1.0]<br />
],<br />
[<br />
[102.0, 2.0], [103.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]<br />
],<br />
[<br />
[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [100.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 2.0], [101.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=77GeoJSON draft version 52007-05-23T21:20:21Z<p>Tschaub: /* FeatureCollection */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or Longitude, Latitude, Elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"type": "Feature",<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 0.0], [101.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"type": "Feature",<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[100.0, 2.0], [101.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=76GeoJSON draft version 52007-05-23T18:05:51Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or Longitude, Latitude, Elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be an object. The structure of that object is beyond the scope of this specification.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=75GeoJSON draft version 52007-05-23T18:00:45Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or Longitude, Latitude, Elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=74GeoJSON draft version 52007-05-23T17:59:25Z<p>Tschaub: /* FeatureCollection */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or Longitude, Latitude, Elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string of the form "EPSG:nnnnn", where "nnnnn" is replaced by the EPSG crs code, e.g. "EPSG:27700". If not present, a default value of "EPSG:4326" should be assumed.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG:27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=73GeoJSON draft version 52007-05-23T17:46:40Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or Longitude, Latitude, Elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string of the form "EPSG:nnnnn", where "nnnnn" is replaced by the EPSG crs code, e.g. "EPSG:27700". If not present, a default value of "EPSG:4326" should be assumed.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG::27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=72GeoJSON draft version 52007-05-23T17:44:46Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. The order of elements follows x, y, z order (or Longitude, Latitude, Elevation for coordinates in decimal degrees).<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the shall be the exterior ring and any others are shall be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string of the form "EPSG:nnnnn", where "nnnnn" is replaced by the EPSG crs code, e.g. "EPSG:27700". If not present, a default value of "EPSG:4326" should be assumed.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG::27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=71GeoJSON draft version 52007-05-23T17:41:09Z<p>Tschaub: /* Specification */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have any number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the shall be the exterior ring and any others are shall be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string of the form "EPSG:nnnnn", where "nnnnn" is replaced by the EPSG crs code, e.g. "EPSG:27700". If not present, a default value of "EPSG:4326" should be assumed.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG::27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=Main_Page&diff=70Main Page2007-05-23T17:29:10Z<p>Tschaub: /* RFCs */</p>
<hr />
<div>== GeoJSON ==<br />
<br />
* [[What_is_JSON%3F|What is JSON?]]<br />
* [[What_is_GeoJSON%3F|What is GeoJSON?]]<br />
<br />
== RFCs ==<br />
*[[RFC-001]]<br />
*[[RFC-2]]<br />
<br />
== Other ==<br />
* [[URL_Encoded_Data|URL Encoded Data (UED)]]<br />
* [http://www.geonames.org/export/JSON-webservices.html Geonames JSON Webservices]<br />
* [http://www.google.com/apis/maps/documentation/#Geocoding_Structured Google's Geocoder JSON Response]<br />
<br />
== Discussion list ==<br />
<br />
* [http://lists.geojson.org/listinfo.cgi/geojson-geojson.org http://lists.geojson.org/listinfo.cgi/geojson-geojson.org]<br />
<br />
== IRC ==<br />
<br />
* [irc://irc.freenode.net/#geojson #geojson] channel on irc.freenode.net</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=69GeoJSON draft version 52007-05-23T17:23:38Z<p>Tschaub: /* Examples */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the shall be the exterior ring and any others are shall be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string of the form "EPSG:nnnnn", where "nnnnn" is replaced by the EPSG crs code, e.g. "EPSG:27700". If not present, a default value of "EPSG:4326" should be assumed.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Each of the examples below represents a complete GeoJSON object. Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG::27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=68GeoJSON draft version 52007-05-23T17:22:27Z<p>Tschaub: /* Examples */</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the shall be the exterior ring and any others are shall be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string of the form "EPSG:nnnnn", where "nnnnn" is replaced by the EPSG crs code, e.g. "EPSG:27700". If not present, a default value of "EPSG:4326" should be assumed.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
Note that unquoted whitespace is not significant in JSON. Whitespace is used in the examples to help illustrate the data structures - though it is not required.<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG::27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=GeoJSON_draft_version_5&diff=67GeoJSON draft version 52007-05-23T17:20:53Z<p>Tschaub: New page: == Overview == GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a ...</p>
<hr />
<div>== Overview ==<br />
<br />
GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and Box. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features.<br />
<br />
A complete GeoJSON data structure is always an object (in JSON terms). In GeoJSON, an ''object'' consists of a collection of name/value pairs - also called ''members''. For each ''member'', the name is always a ''string''. Member ''values'' are either a ''string'', ''number'', ''object'', ''array'' or one of the literals: '''true''', '''false''', and '''null'''. An ''array'' consists of elements where each element is a ''value'' as described above. Note that the term ''member'' generally refers to a name/value pair.<br />
<br />
== Definitions ==<br />
<br />
* JavaScript Object Notation (JSON), and the terms object, name, value, array, and number, are defined at http://json.org/<br />
* The terms may, should, and must are defined at http://www.ietf.org/rfc/rfc2119.txt<br />
<br />
== Specification ==<br />
<br />
# GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, collection of geometries, or collection of features.<br />
# The GeoJSON object may have number of members (name/value pairs).<br />
# The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.<br />
## The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection", "Feature", or "FeatureCollection"<br />
## A geometry is a GeoJSON object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box".<br />
### In addition to the type member, a GeoJSON object that represents a geometry (referred to as a geometry object below) must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.<br />
#### For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension.<br />
#### For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".<br />
#### For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.<br />
#### For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the shall be the exterior ring and any others are shall be interior rings or holes.<br />
#### For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type Polygon.<br />
#### For type "Box", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a Box must have exactly two elements.<br />
### Geometry objects may also have a member with the name "crs" which specifies the coordinate reference system of the coordinates. If present, the value of the crs member must be a string of the form "EPSG:nnnnn", where "nnnnn" is replaced by the EPSG crs code, e.g. "EPSG:27700". If not present, a default value of "EPSG:4326" should be assumed.<br />
## A GeoJSON object with type "GeometryCollection" represents a collection of geomety objects.<br />
### An object of type "GeometryCollection" must have a member with the name "geometries". The value of the geometries member is an array. Each element in this array is a geometry object as defined above.<br />
### A GeometryCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a GeometryCollection has a crs member, the individual geometries in its "geometries" array shall not have their own crs member.<br />
## A GeoJSON object with the type "Feature" represents a geometry with additional properties (referred to as a feature object below). <br />
### A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above (a GeoJSON object with type "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "Box").<br />
### A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object).<br />
## A GeoJSON object with the type "FeatureCollection" represents a collection of feature objects.<br />
### An object of type "FeatureCollection" must have a member with the name "features". The value of the features member is an array. Each element in the array is a feature object as defined above with the exception that feature objects in a FeatureCollection need not have their own member named "type". All elements in the features array of a FeatureCollection must be feature objects and do not need to be identified as features with a "type" member.<br />
### A FeatureCollection object may also have a member with the name "crs" which specifies the coordinate reference system of the collection. If a FeatureCollection has a crs member, the individual features in its "features" array shall not have their own crs member.<br />
<br />
== Examples ==<br />
<br />
=== Geometries ===<br />
==== Point ====<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
}<br />
<br />
==== MultiPoint ====<br />
{<br />
"type": "MultiPoint",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== LineString ====<br />
{<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
==== MultiLineString ====<br />
{<br />
"type": "MultiLineString",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 1.0]<br />
],<br />
[<br />
[2.0, 2.0], [3.0, 3.0]<br />
]<br />
]<br />
}<br />
<br />
==== Polygon ====<br />
No holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
]<br />
]<br />
}<br />
With holes<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
}<br />
<br />
==== MultiPolygon ====<br />
{<br />
"type": "Polygon",<br />
"coordinates": [<br />
[<br />
[<br />
[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 3.0], [2.0, 2.0]<br />
]<br />
],<br />
[<br />
[<br />
[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]<br />
],<br />
[<br />
[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]<br />
]<br />
]<br />
]<br />
}<br />
<br />
==== Box ====<br />
{<br />
"type": "Box",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
<br />
=== GeometryCollection ===<br />
{<br />
"type": "GeometryCollection",<br />
"geometries": [<br />
{<br />
"type": "Point",<br />
"coordinates": [0.0, 0.0]<br />
},<br />
{<br />
"type: "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
]<br />
}<br />
<br />
=== Feature ===<br />
{<br />
"type": "Feature"<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
<br />
=== FeatureCollection ===<br />
{<br />
"type": "FeatureCollection",<br />
"crs": "EPSG::27700",<br />
"features": [<br />
{<br />
"id": "id0",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 0.0], [1.0, 1.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
},<br />
{<br />
"id": "id1",<br />
"geometry": {<br />
"type": "LineString",<br />
"coordinates": [<br />
[0.0, 2.0], [1.0, 3.0]<br />
]<br />
}<br />
"properties": {<br />
"prop0": "value0",<br />
"prop1": "value1"<br />
}<br />
}<br />
]<br />
}</div>Tschaubhttp://wiki.geojson.org/index.php?title=Main_Page&diff=66Main Page2007-05-23T16:44:15Z<p>Tschaub: /* RFCs */</p>
<hr />
<div>== GeoJSON ==<br />
<br />
* [[What_is_JSON%3F|What is JSON?]]<br />
* [[What_is_GeoJSON%3F|What is GeoJSON?]]<br />
<br />
== RFCs ==<br />
[[RFC-001]]<br />
[[RFC-2]]<br />
<br />
== Other ==<br />
* [[URL_Encoded_Data|URL Encoded Data (UED)]]<br />
* [http://www.geonames.org/export/JSON-webservices.html Geonames JSON Webservices]<br />
* [http://www.google.com/apis/maps/documentation/#Geocoding_Structured Google's Geocoder JSON Response]<br />
<br />
== Discussion list ==<br />
<br />
* [http://lists.geojson.org/listinfo.cgi/geojson-geojson.org http://lists.geojson.org/listinfo.cgi/geojson-geojson.org]<br />
<br />
== IRC ==<br />
<br />
* [irc://irc.freenode.net/#geojson #geojson] channel on irc.freenode.net</div>Tschaub