
Hello, I wanted to patch /trunk/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java to map oneway attributes to 'highway=oneway1' adapting the code that was used for the cycleway opposite patch. Attached is what I added but it does not work. Can someone find the mistake or my understanding error? (I would like to do this for several attributes like tracktype, mtb:scale or oneway, currently I render them in different mkgmap runs, and add it together as a layer) I would prefer to have everything in one layer however to save compiling time. I would be fine editing all in this file, or maybe even better would be to have mkgmap call lines0, lines1, lines2, lines3 file and subsequent in one run and put them all into the same .img. I can't use the overlays file, because it's too limited for what I wan't to achieve because I can't possibly list all possible combinations. Find attached the patch I tried to use, please someone help me why it doesn't work (I added highway=oneway1 and oneway1=* in the lines stylefile to search for but id doesn't find them, nor displays them in the map). Index: Osm5XmlHandler.java =================================================================== --- Osm5XmlHandler.java (revision 1052) +++ Osm5XmlHandler.java (working copy) @@ -72,7 +72,8 @@ private static final int MODE_BOUNDS = 5; private static final long CYCLEWAY_ID_OFFSET = 0x10000000; - + private static final long ONEWAY_ID_OFFSET = 0x20000000; + private Node currentNode; private Way currentWay; private Relation currentRelation; @@ -84,7 +85,8 @@ private Runnable endTask; private long nextFakeId = 1; - + + private final boolean makeOnewayOverlay; private final boolean makeOppositeCycleways; private final boolean ignoreBounds; private final boolean ignoreTurnRestrictions; @@ -93,6 +95,7 @@ private final String frigRoundabouts; public Osm5XmlHandler(EnhancedProperties props) { + makeOnewayOverlay = props.getProperty("make-oneway-overlay", false); makeOppositeCycleways = props.getProperty("make-opposite-cycleways", false); ignoreBounds = props.getProperty("ignore-osm-bounds", false); routing = props.containsKey("route"); @@ -314,7 +317,26 @@ log.info("Making opposite cycleway '" + cycleWay.getTag("name") + "'"); } } - } + + + if(makeOnewayOverlay && currentWay.isBoolTag("oneway")) { + String onewayTag = currentWay.getTag("oneway1"); + // what we want is an arrow pointing into the direction + // of the onway attribute, therefore we make a copy of all + // oneway ways except oneway=-1 which we will have to give it's + // own ruleset. + long oneway1Id = currentWay.getId() + ONEWAY_ID_OFFSET; + Way oneway1 = new Way(oneway1Id); + wayMap.put(oneway1Id, oneway1); + // I hope that I made no errors above on copying the code + oneway1.copyTags(currentWay); + log.info("Making Oneway Overlay '"); + } + } + + + + if("motorway".equals(highway) || "trunk".equals(highway)) motorways.add(currentWay);