Moin!
Ich arbeite gerade an einer Optimierung des JOSM codes für multipolygon Relationen. Dabei ist mir zum ersten Mal das geojson format über den Weg gelaufen. JOSM kann ohne plugin geojson schreiben und mit geojson plugin auch lesen.
Allerdings scheint die Konvertierung reichlich wackelig. Ein simples natural=wood MP mit einen natural=water “inner”
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='JOSM'>
<node id='-102235' action='modify' visible='true' lat='52.87146479372' lon='9.50095491532' />
<node id='-102238' action='modify' visible='true' lat='52.87141057091' lon='9.51577711751' />
<node id='-102242' action='modify' visible='true' lat='52.8496075122' lon='9.53149763498' />
<node id='-102244' action='modify' visible='true' lat='52.84879375322' lon='9.50194306214' />
<node id='-102253' action='modify' visible='true' lat='52.86625909527' lon='9.50490750257' />
<node id='-102254' action='modify' visible='true' lat='52.86555410892' lon='9.51362116083' />
<node id='-102256' action='modify' visible='true' lat='52.85659234502' lon='9.51972911396' />
<way id='-102239' action='modify' visible='true'>
<nd ref='-102235' />
<nd ref='-102238' />
<nd ref='-102242' />
<nd ref='-102244' />
<nd ref='-102235' />
</way>
<way id='-102255' action='modify' visible='true'>
<nd ref='-102253' />
<nd ref='-102254' />
<nd ref='-102256' />
<nd ref='-102253' />
<tag k='natural' v='water' />
</way>
<relation id='-102298' action='modify' visible='true'>
<member type='way' ref='-102255' role='inner' />
<member type='way' ref='-102239' role='outer' />
<tag k='natural' v='wood' />
<tag k='type' v='multipolygon' />
</relation>
</osm>
erzeugt eine *.geojson Datei mit diesem Inhalt:
{
"type": "FeatureCollection",
"generator": "JOSM",
"features": [
{
"type": "Feature",
"properties": {
"natural": "water"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
9.50490750257,
52.86625909527
],
[
9.51362116083,
52.86555410892
],
[
9.51972911396,
52.85659234502
],
[
9.50490750257,
52.86625909527
]
]
]
}
},
{
"type": "Feature",
"properties": {
"natural": "wood",
"type": "multipolygon"
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
9.50095491532,
52.87146479372
],
[
9.51577711751,
52.87141057091
],
[
9.53149763498,
52.84960751220
],
[
9.50194306214,
52.84879375322
],
[
9.50095491532,
52.87146479372
]
],
[
[
9.50490750257,
52.86625909527
],
[
9.51362116083,
52.86555410892
],
[
9.51972911396,
52.85659234502
],
[
9.50490750257,
52.86625909527
]
]
]
]
}
},
{
"type": "Feature",
"properties": null,
"geometry": {
"type": "LineString",
"coordinates": [
[
9.50095491532,
52.87146479372
],
[
9.51577711751,
52.87141057091
],
[
9.53149763498,
52.84960751220
],
[
9.50194306214,
52.84879375322
],
[
9.50095491532,
52.87146479372
]
]
}
}
]
}
Es werden also die Koordinaten des inner als polygon ausgegeben, dann das MP selbst mit outer und inner, dann der outer way nochmal als
LineString. Beim Importieren dieser Datei kommt dann auch nichts heraus, was den OSM Daten ähnelt.
Ich frage mich jetzt, ob der Fehler im Format, im Exporter oder im Importer liegt.
Dieses rfc hilft mir da nicht wirklich weiter: https://tools.ietf.org/html/rfc7946
Kann mir jemand einen Hinweis geben?
Das Beispiel, das bei https://wiki.openstreetmap.org/wiki/Overpass_turbo/GeoJSON gezeigt wird, sieht ja doch ziemlich anders aus.
Fragende Grüsse
Gerd