Naar inhoud springen

GeoJSON: verschil tussen versies

Uit Wikipedia, de vrije encyclopedie
Verwijderde inhoud Toegevoegde inhoud
eerste versie
(geen verschil)

Versie van 1 mrt 2014 23:50

GeoJSON
Bestandsextensie .json
MIME-type application/json
Ontwikkeld door http://geojson.org/
Portaal  Portaalicoon   Informatica

GeoJSON[1] is an open standard format for encoding collections of simple geographical features along with their non-spatial attributes using JavaScript Object Notation. The features include points (therefore addresses and locations), line strings (therefore streets, highways and boundaries), polygons (countries, provinces, tracts of land), and multi-part collections of these types. GeoJSON features need not represent entities of the physical world only; mobile routing and navigation apps, for example, might describe their service coverage using GeoJSON.[2]

Historie

Het formaat is niet opgesteld door een formele organisatie, maar door een werkgrope van ontwikkelaars, de GeoJSON format working group vanaf maart 2007[3]. De specificatie was klaar in juni 2008.

Voorbeeld

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [102.0, 0.6]
      },
      "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": {
        "prop1": 0.0,
        "prop0": "value0"
      }
    },
    {
      "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": {
        "prop1": {
          "this": "that"
        },
        "prop0": "value0"
      }
    }
  ]
}

Geometries

Geometry primitives
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]]
    ]
}
Multipart geometries
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]]
        ]
    ]
}

Software

Het GeoJSON formaat wordt ondersteund door een groot aantal programma's waaronder OpenLayers,[4] Leaflet, Geoforge software,[5] GeoServer,[6] GeoDjango,[7] GDAL,[8] Safe Software FME,[9] en CartoDB,[10]

Het is ook mogelijk GeoJSON te gebruiken met PostGIS[11] en Mapnik,[12]. Beide behandelen het formaat via de GDAL OGR-conversie bibliotheek. Bing Maps, Yahoo! en Google bieden ondersteuning voor GeoJSON in hun API-diensten. GitHub biedt ook GeoJSON rendering.[13]

Referenties

  1. The GeoJSON Format Specification
  2. iOS Location and Maps Programming Guide
  3. March 2007 Archives by thread
  4. http://openlayers.org/dev/examples/vector-formats.html
  5. http://leafletjs.com/reference.html#geojson
  6. http://svn.codehaus.org/geoserver/tags/2.0.0-alpha1/geoserver/release/README.txt
  7. http://geodjango.org/docs/db-api.html
  8. http://gdal.org/ogr/drv_geojson.html
  9. http://www.safe.com/reader_writerPDF/geojson.pdf
  10. http://developers.cartodb.com/documentation/cartodb-js.html
  11. http://pugs.postgresql.org/files/Introduction_to_PostGIS_v1.0.pdf
  12. http://svn.mapnik.org/tags/release-0.6.0/docs/api_docs/python/mapnik-module.html
  13. https://github.com/blog/1528-there-s-a-map-for-that

Externe links