Benutzer:Stundzig/GeoJSON
GeoJSON[1] is an open standard format designed for representing simple geographical features, along with their non-spatial attributes, based on JavaScript Object Notation.[2][3]
The features include points (therefore addresses and locations), line strings (therefore streets, highways and boundaries), polygons (countries, provinces, tracts of land), and multi-part collections of these types. GeoJSON features need not represent entities of the physical world only; mobile routing and navigation apps, for example, might describe their service coverage using GeoJSON.[4]
The GeoJSON format differs from other GIS standards in that it was written and is maintained not by a formal standards organization, but by an Internet working group of developers.[5]
A notable offspring of GeoJSON is TopoJSON, an extension of GeoJSON that encodes geospatial topology and that typically provides smaller file sizes.
History
The GeoJSON format working group and discussion were begun in March 2007[6] and the format specification was finalized in June 2008.
Example
{ "type": "FeatureCollection",
"features": [
{ "type": "Feature",
"geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
"properties": {"prop0": "value0"}
},
{ "type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
]
},
"properties": {
"prop0": "value0",
"prop1": 0.0
}
},
{ "type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
[100.0, 1.0], [100.0, 0.0] ]
]
},
"properties": {
"prop0": "value0",
"prop1": {"this": "that"}
}
}
]
}
Geometries
| Type | Examples | |
|---|---|---|
| Point | { "type": "Point",
"coordinates": [30, 10]
}
| |
| LineString | { "type": "LineString",
"coordinates": [
[30, 10], [10, 30], [40, 40]
]
}
| |
| Polygon | { "type": "Polygon",
"coordinates": [
[[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
]
}
| |
{ "type": "Polygon",
"coordinates": [
[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]],
[[20, 30], [35, 35], [30, 20], [20, 30]]
]
}
| ||
| Type | Examples | |
|---|---|---|
| MultiPoint | { "type": "MultiPoint",
"coordinates": [
[10, 40], [40, 30], [20, 20], [30, 10]
]
}
| |
| MultiLineString | { "type": "MultiLineString",
"coordinates": [
[[10, 10], [20, 20], [10, 40]],
[[40, 40], [30, 30], [40, 20], [30, 10]]
]
}
| |
| MultiPolygon | { "type": "MultiPolygon",
"coordinates": [
[
[[30, 20], [45, 40], [10, 40], [30, 20]]
],
[
[[15, 5], [40, 10], [10, 20], [5, 10], [15, 5]]
]
]
}
| |
{ "type": "MultiPolygon",
"coordinates": [
[
[[40, 40], [20, 45], [45, 30], [40, 40]]
],
[
[[20, 35], [10, 30], [10, 10], [30, 5], [45, 20], [20, 35]],
[[30, 20], [20, 15], [20, 25], [30, 20]]
]
]
}
| ||
Supported software
GeoJSON is supported by numerous mapping and GIS software packages, including OpenLayers,[7] Leaflet, MapServer,[8] Geoforge software,[9] GeoServer,[10] GeoDjango,[11] PointPlot, [12] GDAL,[13] Safe Software FME,[14] and CartoDB.[15] It is also possible to use GeoJSON with PostGIS[16] and Mapnik,[17] both of which handle the format via the GDAL OGR conversion library. Bing Maps, Yahoo! and Google also support GeoJSON in their API services.
The Google Maps Javascript API v3 directly supports the integration of GeoJSON data layers [18] as of March 19, 2014.[19]
GitHub also supports GeoJSON rendering[20] and Potrace GeoJSON export.
TopoJSON
TopoJSON is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs.[21] Arcs are sequences of points, while line strings and polygons are defined as sequences of arcs. Each arc is defined only once, but can be referenced several times by different shapes, thus reducing redundancy and decreasing the file size.[22] In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms.
A reference implementation of the TopoJSON specification is available as a command-line tool to encode TopoJSON from GeoJSON (or ESRI Shapefiles) and a client side JavaScript library to decode TopoJSON back to GeoJSON again. TopoJSON is also supported by the popular OGR tool as of version 1.11[23] and PostGIS as of version 2.1.0.[24]
TopoJSON Schema
Given a GIS shape near coordinates latitude 0° en longitude 0° a simple but valid and complete topojson file containing all metadata, Polygon, LineString, Point elements, arcs and properties is defined as follows:

{
"type":"Topology",
"transform":{
"scale": [1,1],
"translate": [0,0]
},
"objects":{
"two-squares":{
"type": "GeometryCollection",
"geometries":[
{"type": "Polygon", "arcs":[[0,1]],"properties": {"name": "Left_Polygon" }},
{"type": "Polygon", "arcs":[[2,-1]],"properties": {"name": "Right_Polygon" }}
]
},
"one-line": {
"type":"GeometryCollection",
"geometries":[
{"type": "LineString", "arcs": [3],"properties":{"name":"Under_LineString"}}
]
},
"two-places":{
"type":"GeometryCollection",
"geometries":[
{"type":"Point","coordinates":[0,0],"properties":{"name":"Origine_Point"}},
{"type":"Point","coordinates":[0,-1],"properties":{"name":"Under_Point"}}
]
}
},
"arcs": [
[[1,2],[0,-2]],
[[1,0],[-1,0],[0,2],[1,0]],
[[1,2],[1,0],[0,-2],[-1,0]],
[[0,-1],[2,0]]
]
}
References
- ↑ The GeoJSON Format Specification
- ↑ Leonard Richardson, Mike Amundsen, Sam Ruby: RESTful Web APIs. "O'Reilly Media, Inc.", 2013, ISBN 978-1-4493-5974-4, S. 228 (google.com): „Geojson: A Trobled Type ... a standard based on JSON, designed for representing geographic features like points on a map. ... There's another problem with GeoJSON: Iit has no registered media type. A GeoJSON document is served as application/json, just like any other JSON document. How is a client supposed to distinguish between geoJSON and plain old JSON?“
- ↑ Erik Westra: Python Geospatial Analysis Essentials. Packt Publishing Ltd, 2015, ISBN 978-1-78355-389-1, S. 27 (google.com): „GeoJSON ... is an open standard used to represent geospatial data structures as JavaScript Object Notation (JSON) objects.“
- ↑ iOS Location and Maps Programming Guide
- ↑ The GeoJSON Discussion List
- ↑ March 2007 Archives by thread
- ↑ http://openlayers.org/dev/examples/vector-formats.html
- ↑ http://mapserver.org/output/template_output.html
- ↑ http://leafletjs.com/reference.html#geojson
- ↑ http://svn.codehaus.org/geoserver/tags/2.0.0-alpha1/geoserver/release/README.txt
- ↑ http://geodjango.org
- ↑ http://www.ndm.io
- ↑ http://gdal.org/ogr/drv_geojson.html
- ↑ http://www.safe.com/reader_writerPDF/geojson.pdf
- ↑ http://developers.cartodb.com/documentation/cartodb-js.html
- ↑ http://pugs.postgresql.org/files/Introduction_to_PostGIS_v1.0.pdf
- ↑ http://svn.mapnik.org/tags/release-0.6.0/docs/api_docs/python/mapnik-module.html
- ↑ https://developers.google.com/maps/documentation/javascript/examples/layer-data-simple
- ↑ http://googledevelopers.blogspot.com/2014/03/maps-made-easier-geojson-in-javascript.html
- ↑ https://github.com/blog/1528-there-s-a-map-for-that
- ↑ https://github.com/topojson/topojson-specification
- ↑ https://github.com/mbostock/topojson/wiki
- ↑ GDAL/OGR 1.11.0 Release Notes
- ↑ PostGIS AsTopoJSON
Sources
- http://geojson.org/
- http://geojson.org/geojson-spec.html
- Christopher Andrews: Emerging Technology: AJAX and GeoJSON. 18. September 2007.
- Geoweb Guru: Technical Overview: GeoJSON. 16. Februar 2009.
- Chris Lambert: Google Geo Developers Blog: Build on top of your public Latitude location with GeoJSON & KML. 4. Mai 2009.
- https://github.com/mbostock/topojson
- https://github.com/topojson/topojson-specification
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.