[Merkaartor] One Way

Vincent MEURISSE vincent.meurisse at gmail.com
Tue Apr 29 10:24:18 BST 2008


The interpretation of the tag oneway is wrong in the current
implementation of merkaartor.
Here is the wiki page on it:
http://wiki.openstreetmap.org/index.php/OSM_tags_for_routing
Could someone with write access on the svn apply this patch.
Thanks.


Index: Map/Road.cpp
===================================================================
--- Map/Road.cpp        (revision 7575)
+++ Map/Road.cpp        (working copy)
@@ -379,12 +379,20 @@
        QString d;
        unsigned int idx=R->findKey("oneway");
        if (idx<R->tagSize())
+       {
                d = R->tagValue(idx);
-       else
-               return MapFeature::UnknownDirection;
-       if ( (d == "yes") || (d == "1") ) return MapFeature::OneWay;
-       if (d == "no") return MapFeature::BothWays;
-       if (d == "-1") return MapFeature::OtherWay;
+               if ( (d == "yes") || (d == "1") || (d == "true"))
return MapFeature::OneWay;
+               if (d == "-1") return MapFeature::OtherWay;
+               if ((d == "no") || (d == "false") || (d == "0"))
return MapFeature::BothWays;
+       }
+
+       idx=R->findKey("junction");
+       if (idx<R->tagSize())
+       {
+               d = R->tagValue(idx);
+               if(d=="roundabout") return MapFeature::OneWay;
+               //TODO For motorway and motorway_link, this is still
discussed on the wiki.
+       }
        return MapFeature::UnknownDirection;
 }




More information about the Merkaartor mailing list