GeoJSON

GeoJSON
Rozszerzenia pliku

.json.geojson

Typ MIME

application/geo+json

Otwarty format?

tak

Strona internetowa

GeoJSONotwarty standard format przeznaczony do reprezentowania prostych obiektów geograficznych wraz z ich nieprzestrzennymi atrybutami. Opiera się na formacie JSON.

Obiekty (Feature) obejmują punkty (mogą zwierać adresy i lokalizacje), linie łamane (np. ulice, drogi i granice), wielokąty (np. obszary, miasta, kraje, kontynenty) oraz wieloczęściowe kolekcje różnego typu. Obiekty GeoJSON nie muszą reprezentować tylko fizycznie istniejących obiektów – np. mobilne aplikacje do nawigacji mogą opisywać zasięg swoich usług za pomocą GeoJSON[1].

Format GeoJSON różni się od innych standardów GIS tym, że nie został opracowany przez formalną organizację normalizacyjną, ale przez internetową grupę roboczą programistów[2].

Jednym z rozszerzeń GeoJSON jest TopoJSON, który koduje topologię geoprzestrzenną w postaci połączonych obiektów i zazwyczaj zapewnia mniejsze rozmiary plików.

Format GeoJSON jest wykorzystywany m.in. przez biblioteki do wyświetlania dynamicznych map na stronach internetowych np. OpenLayers, Leaflet(inne języki).

Historia

Grupa robocza standardu GeoJSON i dyskusja rozpoczęły się w marcu 2007[3], a specyfikacja formatu została ukończona w czerwcu 2008.

W kwietniu 2015 r. Internet Engineering Task Force założył grupę roboczą Geographic JSON[4], która w sierpniu 2016 r. wydała GeoJSON jako RFC 7946 ↓.

Przykład

{
  "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" }
      }
    }
  ]
}

Obiekty geometryczne (Features)

Punkty są reprezentowane jako [x, y] lub [x, y, z]. Mogą to być długość i szerokość geograficzna lub współrzędne kartezjańskie. Wysokość to opcjonalna trzecia liczba. Zapisywane jako liczby dziesiętne[5].

Na przykład Londyn (51,5074° N, 0,1278° E) to [-0,1278, 51,5074]

Prymitywy geometryczne
Typ Przykład
Punkt (Point)
{
    "type": "Point",
    "coordinates": [30.0, 10.0]
}
Linia łamana (LineString)
{
    "type": "LineString",
    "coordinates": [
        [30.0, 10.0],
        [10.0, 30.0],
        [40.0, 40.0]
    ]
}
Wielokąt (Polygon)
{
    "type": "Polygon",
    "coordinates": [
        [
            [30.0, 10.0],
            [40.0, 40.0],
            [20.0, 40.0],
            [10.0, 20.0],
            [30.0, 10.0]
        ]
    ]
}
{
    "type": "Polygon",
    "coordinates": [
        [
            [35.0, 10.0],
            [45.0, 45.0],
            [15.0, 40.0],
            [10.0, 20.0],
            [35.0, 10.0]
        ],
        [
            [20.0, 30.0],
            [35.0, 35.0],
            [30.0, 20.0],
            [20.0, 30.0]
        ]
    ]
}
Obiekty złożone
Typ Przykład
Wielopunkt (MultiPoint)
{
    "type": "MultiPoint",
    "coordinates": [
        [10.0, 40.0],
        [40.0, 30.0],
        [20.0, 20.0],
        [30.0, 10.0]
    ]
}
Linie łamane (MultiLineString)
{
    "type": "MultiLineString",
    "coordinates": [
        [
            [10.0, 10.0],
            [20.0, 20.0],
            [10.0, 40.0]
        ],
        [
            [40.0, 40.0],
            [30.0, 30.0],
            [40.0, 20.0],
            [30.0, 10.0]
        ]
    ]
}
Wielokąty (MultiPolygon)
{
    "type": "MultiPolygon",
    "coordinates": [
        [
            [
                [30.0, 20.0],
                [45.0, 40.0],
                [10.0, 40.0],
                [30.0, 20.0]
            ]
        ],
        [
            [
                [15.0, 5.0],
                [40.0, 10.0],
                [10.0, 20.0],
                [5.0, 10.0],
                [15.0, 5.0]
            ]
        ]
    ]
}
{
    "type": "MultiPolygon",
    "coordinates": [
        [
            [
                [40.0, 40.0],
                [20.0, 45.0],
                [45.0, 30.0],
                [40.0, 40.0]
            ]
        ],
        [
            [
                [20.0, 35.0],
                [10.0, 30.0],
                [10.0, 10.0],
                [30.0, 5.0],
                [45.0, 20.0],
                [20.0, 35.0]
            ],
            [
                [30.0, 20.0],
                [20.0, 15.0],
                [20.0, 25.0],
                [30.0, 20.0]
            ]
        ]
    ]
}
Kolekcja obiektów (GeometryCollection)
{
    "type": "GeometryCollection",
    "geometries": [
        {
            "type": "Point",
            "coordinates": [40.0, 10.0]
        },
        {
            "type": "LineString",
            "coordinates": [
                [10.0, 10.0],
                [20.0, 20.0],
                [10.0, 40.0]
            ]
        },
        {
            "type": "Polygon",
            "coordinates": [
                [
                    [40.0, 40.0],
                    [20.0, 45.0],
                    [45.0, 30.0],
                    [40.0, 40.0]
                ]
            ]
        }
    ]
}

Zobacz też

Przypisy

  1. Providing Directions. developer.apple.com.
  2. GeoJSON Info Page. lists.geojson.org.
  3. The GeoJSON March 2007 Archive by thread. lists.geojson.org.
  4. Geographic JSON (geojson) -. datatracker.ietf.org.
  5. GeoJSON RFC #3.1.1.

Bibliografia

Linki zewnętrzne

  • H. Butler i inni, The GeoJSON Format, RFC 7946, IETF, sierpień 2016, DOI10.17487/RFC7946, ISSN 2070-1721, OCLC 943595667 (ang.).
  • Oficjalna strona projektu
  • Walidator GeoJSON
  • TopoJSON

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.

  1. 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:
  2. 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.
  3. 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.
  4. 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.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
Kembali kehalaman sebelumnya