I’ve used osmium export
before to export ways
to geojson.
Now my input data (osm.pbf) also includes relations, which I also want to export.
Unfortunately, the Osmium export GeoJSON only contains relations with route=ferry
etc. but none with route=bicycle
. I double checked, that the original osm.pbf
file contains those bicycle
routes.
Why is this data missing?
I think the issue is that the route=bicycle
relation consists of ways
, so osmium
would have to look up the nodes of the ways which might be too much work?
<relation id="13068" version="300" timestamp="2024-07-28T18:45:56Z">
<member type="way" ref="24543938" role=""/>
...
<member type="way" ref="34238509" role=""/>
...
<tag k="network" v="rcn"/>
<tag k="route" v="bicycle"/>
<tag k="type" v="route"/>
...
</relation>
The route=ferry
seems to be tagged directly to the ways
which consists of nodes, so only the node geometry has to be looked up:
<way id="8255835" version="19" timestamp="2021-03-02T17:17:12Z">
<nd ref="86106056"/>
<nd ref="300319974"/>
<tag k="bicycle" v="yes"/>
...
<tag k="route" v="ferry"/>
</way>
GeoJson of a ferry route:
{"type":"Feature","geometry":{"type":"LineString","coordinates":[[13.883699,50.9806137],[13.8851345,50.9801962]]},"properties":{"bicycle":"yes","foot":"yes","motor_vehicle":"no","motorcar":"no","motorcycle":"yes","name":"Fährstelle Birkwitz-Heidenau","opening_hours":"Mo-Fr 04:30-23:00; Sa,Su 07:00-23:00","ref":"F10","route":"ferry"}},
So my guess is, that osmium
only extracts ways, not “really” relations, as they don’t have their own geometry.