logo separator

[mkgmap-dev] Issue with exits ref and possible patch

From Nakor nakor.wp at gmail.com on Wed Sep 30 18:57:54 BST 2009

   Hello,

I have noticed that in case an exit node is linked to several highways
(maybe this is bad mapping practice but it exists) and one of them does not
have a ref tag, mkgmap issues a warning that the exit was not assigned a ref
(see nodes 62152165 and 61852851 for an example).

Below is an patch that tries to fix this:

Index: src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
(revision 1246)
+++ src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java    (working
copy)
@@ -432,19 +432,21 @@
         for (Node e : exits) {
             String refTag = Exit.TAG_ROAD_REF;
             if(e.getTag(refTag) == null) {
+                String ref = null;
                 for (Way w : motorways) {
-                    String ref = w.getTag("ref");
                     if (w.getPoints().contains(e.getLocation())) {
-                        if(ref != null) {
-                            log.info("Adding " + refTag + "=" + ref + " to
exit" + e.getTag("ref"));
-                            e.addTag(refTag, ref);
-                        }
-                        else {
-                            log.warn("Motorway exit is positioned on a
motorway that doesn't have a 'ref' tag");
-                        }
-                        break;
+                      ref = w.getTag("ref");
+                        if(ref != null)
+                            break;
                     }
                 }
+                if(ref != null) {
+                    log.info("Adding " + refTag + "=" + ref + " to exit" +
e.getTag("ref"));
+                    e.addTag(refTag, ref);
+                }
+                else {
+                    log.warn("Motorway exit is positioned on a motorway
that doesn't have a 'ref' tag");
+                }
             }
         }




Thanks,

N.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090930/193eb7b2/attachment.html 


More information about the mkgmap-dev mailing list