logo separator

[mkgmap-dev] mkgmap dropping ways on multipolygon boundary "outer"

From Mark Burton markb at ordern.com on Sun Dec 27 21:33:38 GMT 2009

Festive greetings Felix,

> Have a look here, wherever the boundaries use the same way as the ways, 
> the ways get dropped, even if not rendering the boundaries at all 
> (removing any reference to boundary from the style-file).
> Is this maybe a geofabrik error, or some error in mkgmap multipolygon 
> handling? I have noticed many (all that I checked) mkgmap maps suffer 
> from missing roads in this example. (anyhow I don't render boundaries 
>  >admin_level=6)
> http://www.openstreetmap.org/?lat=48.03113&lon=16.88459&zoom=16&layers=B000FTF
> Seems to be a bug in the Multipolygon Code.

Perhaps it's the same issue as I mentioned yesterday (outer ways in
multipolygons are trashed by the process of generating the polygon). I
suggested that we should duplicate() the outer ways to preserve their
original use. As it stands, if a way is referenced in some multipolygon
its tags are wiped out so it will not work as the original author of
the way intended.



diff --git a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
index acc5cf9..fbb1d57 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
@@ -266,10 +266,12 @@ class Osm5XmlHandler extends DefaultHandler {
        private void startInRelation(String qName, Attributes attributes) {
                if (qName.equals("member")) {
                        long id = idVal(attributes.getValue("ref"));
-                       Element el;
+                       Element el = null;
                        String type = attributes.getValue("type");
-                       if ("way".equals(type)){
-                               el = wayMap.get(id);
+                       if ("way".equals(type)) {
+                               Way way = wayMap.get(id);
+                               if(way != null)
+                                       el = way.duplicate();
                        } else if ("node".equals(type)) {
                                el = nodeMap.get(id);
                                if(el == null) {

More information about the mkgmap-dev mailing list