pgRouting / osm2pgrouting

Import tool for OpenStreetMap data to pgRouting database
https://pgrouting.org
GNU General Public License v2.0
291 stars 111 forks source link

Incorrect classification of one-ways #240

Closed dhshawn closed 5 years ago

dhshawn commented 6 years ago

I used osm2pgrouting to import this two-way trunk road: https://www.openstreetmap.org/way/66799462

It doesn't have any direction tags. image

After importing using osm2pgrouting it has been flagged as a one-way, which seems to be incorrect?

image

I am a GIS novice; it's possible that there is a simple solution/explanation.

Thanks.

dhshawn commented 6 years ago

In the source code I see that highway-trunks are implied to be one-ways. This is not accurate.

cayetanobv commented 6 years ago

Hi @dhshawn ,

According to OSM you are right: https://wiki.openstreetmap.org/wiki/Key:oneway

AFAIK restriction oneway=yes is only implied in junction=roundabout and highway=motorway. In OSM wiki says "others" but I don't know more cases to apply this restriction. Let me know if you know other applications.

I created this PR to solve this problem: https://github.com/pgRouting/osm2pgrouting/pull/241

Thanks,