mkgmap dropping ways on multipolygon boundary "outer"

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=B000F... Seems to be a bug in the Multipolygon Code.

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=B000F...
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. Cheers, Mark 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) {

On 27.12.2009 22:33, Mark Burton wrote:
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=B000F...
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.
Cheers,
Mark
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) {
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Thanks for that patch... It does remove the bug, but all relations seem to get dropped by using this patch too. So not an ideal solution -:) BTW before using this patch, relations like cycleroutes would even show up when all ways were dropped due to multipolygon outer...

Felix,
Thanks for that patch... It does remove the bug, but all relations seem to get dropped by using this patch too. So not an ideal solution -:)
BTW before using this patch, relations like cycleroutes would even show up when all ways were dropped due to multipolygon outer...
OK - try this new version: diff --git a/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java b/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java index e2f3c64..0ff5659 100644 --- a/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java +++ b/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java @@ -35,7 +35,7 @@ public class MultiPolygonRelation extends Relation { String value = pairs.getValue(); if (value != null && pairs.getKey() instanceof Way) { - Way way = (Way) pairs.getKey(); + Way way = ((Way)pairs.getKey()).duplicate(); if (value.equals("outer")){ outers.add(way); } else if (value.equals("inner")){

On 28.12.2009 00:04, Mark Burton wrote:
Felix,
Thanks for that patch... It does remove the bug, but all relations seem to get dropped by using this patch too. So not an ideal solution -:)
BTW before using this patch, relations like cycleroutes would even show up when all ways were dropped due to multipolygon outer...
OK - try this new version:
diff --git a/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java b/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java index e2f3c64..0ff5659 100644 --- a/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java +++ b/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java @@ -35,7 +35,7 @@ public class MultiPolygonRelation extends Relation { String value = pairs.getValue();
if (value != null&& pairs.getKey() instanceof Way) { - Way way = (Way) pairs.getKey(); + Way way = ((Way)pairs.getKey()).duplicate(); if (value.equals("outer")){ outers.add(way); } else if (value.equals("inner")){
Yip, that patch works great. (using only this patch, without the earlier patch; if I add earlier patch too I loose the relations again)
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Felix,
Yip, that patch works great. (using only this patch, without the earlier patch; if I add earlier patch too I loose the relations again)
Yes, it replaces the earlier patch. Good. I am tempted to commit this - does anyone think that preserving the original ways is a bad idea? If so, please speak up. Cheers, Mark

On 28.12.2009 09:42, Mark Burton wrote:
Hi Felix,
Yip, that patch works great. (using only this patch, without the earlier patch; if I add earlier patch too I loose the relations again)
Yes, it replaces the earlier patch.
Good.
I am tempted to commit this - does anyone think that preserving the original ways is a bad idea? If so, please speak up.
Cheers,
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Is there a reason for not committing the patch? It is working great for me and also Steve found it good But yes, maybe they should be duplicated as well, I'm not against duplicating the ways (and I like Mark's second patch), just against) doing it twice without a rationale. I am using it since a few days without probs. I have not noticed any missing coastlines using this patch (though I did not have a look at places with many coastlines due to islands). Felix -- diff --git a/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java b/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java index e2f3c64..0ff5659 100644 --- a/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java +++ b/src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java @@ -35,7 +35,7 @@ public class MultiPolygonRelation extends Relation { String value = pairs.getValue(); if (value != null&& pairs.getKey() instanceof Way) { - Way way = (Way) pairs.getKey(); + Way way = ((Way)pairs.getKey()).duplicate(); if (value.equals("outer")){ outers.add(way); } else if (value.equals("inner")){

Hello Felix,
Is there a reason for not committing the patch? It is working great for me and also Steve found it good
It has some good aspects but it also (as I think Steve mentioned) has the downside of causing the sea polygon to be preserved so everything ends up sea colour. As the multipolygon stuff is being revamped anyway, a better fix can be rolled into that. Cheers, Mark
participants (2)
-
Felix Hartmann
-
Mark Burton