
Mark, Here you go. 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"); + } } }