0

I use osm2po to create a routable network from OSM data and this works great. Although I feel quite familiar with osm2po nowadays, there is one thing I can not solve using PgRoutingWriter's output: routing using mulipolygon relations.

What I am trying to achieve is taking places/areas that are tagged with area=yes and foot=yes into account.

A location where this comes into play is the Waltherplatz in Bozen/Bolzano (but I am also sure that there are a ton of others as well)... ways end at the border of the place, one side is even bound by a street, but even when routing with type "foot" I can not get from one side to the other.

Can I somehow tell osm2po that it should use relations as well (not only ways) when creating my routable network (uncommenting the relationTagResolver.class in the config file does not seem to be enough)?

A very old question about a similar topic can be found here, but since it is 5 years old I guess it is a bit outdated (hopefully).

I know that this is still a problem that is under research, but I would be happy with a very basic solution (something like "walk along the outer line of the multipolygon"). Right now I do not need a better solutions like building all possible routes across a place...

2

osm2po is able to reconstruct areas of ways on the first recursion level. Meaning, osm2po cannot rebuild them from relations which themselves contain relations. However, your assumption is correct. Though it's quite calm around osm2po lately, I've been spending lots of free time to solve major issues of this common problem. There is no optimal way to solve it, but there are some tricky things one can do.

Firstly, in order to translate areas, download the latest version. Yes, sounds quite fresh, ... and yes indeed, it actually is.

Configure sth. like this here, or at least play around with it: (BTW: watt is the german word for tidal flat)

cmd=tzjp
tileSize=x
prefix=watt
disablePreFilter=true
rtr.support.polygon.type.1=natural/wetland,wetland/tidalflat
rtr.support.restrictions=false
postp.1.class=de.cm.osm2po.plugins.postp.PgPolyRelWriter
postp.2.class=de.cm.osm2po.plugins.postp.PgPolyWayWriter
wtr.flagList=watt
wtr.finalMask=watt
wtr.polyMask=watt
wtr.tag.wetland.tidalflat=1,1,1,watt

This config catches both, tidal flats tagged as Ways and Relations! Well, osm2po is still not complete with regards to areas, but I'm currently working on it. I hope, that in near future I can find an easy way to handle most of these issues with a simple configuration. Till then, either ask me per mail and/or enjoy these screenshots (it's more or less the same problem):

enter image description here

Detailed snapshot of green point (source): enter image description here

0

With the help of carsten I was able to solve the problem. Although the solution is far from perfect (and therefore might not be suitable for inclusion into osm2po without further improvements), it is sufficient for my needs.

Things that are needed for routing over places are:

1) Find the places that should become routable. This can be done by using osm2po and the PgPolyRelWriter (and the PgPolyWayWriter) with the settings posted in the answer by carsten

2) Build a so called SpiderWebGraph for each of these places. Connect the graph to near vertices of the routable network (e.g. the street network) and export it as ".osm" file. This can be done by combining PostGIS SQL queries after importing the places found in step 1 and the routable network (which can again be created using osm2po). For more information about this step look at my project isochrone-datamodel (especially at the package at.uibk.dbis.isochrone.datamodel.impl.street in src/main/java and src/main/resources)

3) Merge the original network with the one created in step 2. This can be done using osm2po and the merge command (cmd=m). All other steps are identical to the ones when working with osm2po when not routing over places. Again, some more information is located in the isochrone-datamodel project (in the script osmPti2mmds.sh script located in the root folder. Be sure to take a look at the "fn_create_street_network" function here...)

I want to thank carsten for his great support and for his extraordinary good tool osm2po. This solution wouldn't be possible without him (and his tool) :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.