You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2013-07-14 11:25:34

Glad
Member
Registered: 2008-08-15
Posts: 235

Overpass Turbo + Geojson

Overpass Turbo generiert fast auf Knopfdruck Daten in einem JSON Format. Mit einem zweiten könnte Leaflet sie anzeigen.
Meine Frage: wie kann ich die Nodes in ein anderes (Geo-) JSON Format konvertieren?
Beispiel: overpass Turbo erzeugt:

{
  "type": "node",
  "id": 1,
  "lat": 50,
  "lon": 7,
  "tags": {
    "tag": "value",
    "name": "demoname"
  }

Haben möchte ich:

{
    "type": "Feature",
    "id": 1,
    "properties": {
        "name": "demoname",
        "tag": "value",
        "popupContent": "have fun"
    },
    "geometry": {
        "type": "Point",
        "coordinates": [7, 50]
    }
};

Nachtrag:
Vielleicht macht es auch mehr Sinn, das Leaflet Einlesescript anzupassen?
Dann bleibt zumindest die Frage: Welche Werkzeuge gibt es, um von der einen Objektstruktur in die andere zu wechseln (mein naiver Ansatz: JSON1 -> simple Liste -> JOSN2)?

Last edited by Glad (2013-07-14 12:36:01)

Offline

#2 2013-07-14 15:33:37

tyr_asd
Member
Registered: 2012-08-23
Posts: 81
Website

Re: Overpass Turbo + Geojson

Schau dir mal im Menü Export den Punkt "als GeoJSON" an. wink

Offline

#3 2013-07-15 19:30:16

Glad
Member
Registered: 2008-08-15
Posts: 235

Re: Overpass Turbo + Geojson

tyr_asd wrote:

Export

Danke!

Offline

Board footer

Powered by FluxBB