Re: [mkgmap-dev] mkgmap dropping ways on multipolygon boundary outer
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
Re: [mkgmap-dev] Buggy data (was: boundary relations duplicated by splitter, not merged by mkgmap)
Hi Steve, It looks like the relation with the name Sverige is repeated three times in one .osm file, or alternatively the relation contains the same way three times. That could be a splitter bug or even a bug in the original data. When I build the map with only two tiles, fewer buggy labels will be generated for the Swedish border: SVERIGE/NORRA NORRLAND/NORRA NORRLAND/NORRBOTTENS LÄN/NORRBOTTENS LÄN/SUOMI SVERIGE/NORRA NORRLAND/NORRA NORRLAND/NORRA NORRLAND/NORRBOTTENS LÄN/NORRBOTTENS LÄN/NORRBOTTENS LÄN/SUOMI Note 3 copies of NORRA NORRLAND and NORRBOTTENS LÄN, even though there are only two tiles now. The Swedish border http://www.openstreetmap.org/browse/relation/52822 has been last edited on Dec 24. The provincial relations are http://www.openstreetmap.org/browse/relation/52824 (Norrbottens län) http://www.openstreetmap.org/browse/relation/52828 (Norra Norrland) I just added some name:* translations to the relations. Other than that, the last changes were on Dec 4 (id:52828) and Dec 22 (id:52824). The data seems to be buggy, after all: id:52824 contains duplicates for ways 43024656, 44089880 id:52828 contains duplicates for way 43024656 Sorry for the noise. I will remove the duplicates from the data. This was one more triumph for mkgmap's validation capabilities. Marko ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] Multipolygons and disappearing coastlines
On 26/12/09 22:11, Mark Burton wrote: Hi Chris, Mark Burton schrieb: So, is putting the coastline into a multipolygon a reasonable OSM thing? A coastline is often also a boundary and boundaries are multipolygons in OSM. If so, should mkgmap be breaking the coastline by removing its tags? If not, how do we fix that? My guess is, that the multipolygon handling in mkgmap is not working perfectly. See an older thread on this list where I suggest a workaround. (I check if the MP has no inner elements and change the type=multipolygon to type=boundarypolygon if this is the case). Chris OK, that's understood. But why do we have to trash the original ways when we make a multipolygon from them? Would it not be better to give the relation a duplicate of the way to trash so that the original way can go on to serve its original purpose. Perhaps we should do this: 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) { I just tried this patch and (just like magic) the coastline reappears. But do you also magically get an extra unwanted polygon when the relation is a cascading multipolygon? Aside from that, the multipolygon code already does duplicate the way before removing the tags from the original. Duplicating it again can't be the right solution. ..Steve ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] Multipolygons and disappearing coastlines
Aside from that, the multipolygon code already does duplicate the way before removing the tags from the original. Duplicating it again can't be the right solution. Only the outer way is duplicated. Inner ways seems to be kept but all tags are removed. WanMil ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] Multipolygons and disappearing coastlines
On 28/12/09 11:46, WanMil wrote: Hi Aside from that, the multipolygon code already does duplicate the way before removing the tags from the original. Duplicating it again can't be the right solution. Only the outer way is duplicated. Inner ways seems to be kept but all tags are removed. Only tags from the inner way that are also present on the outer way are removed according to the code. 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. This history as far as I can remember for removing tags from the ways in the manner that it is done is to prevent duplicate polygons in cases when people have needlessly/incorrectly/historically tagged both the relation and the ways that make it up, particularly in the lake-on-an-island-in-a-forest case. I've read the links that you posted earlier in the thread and I'd would like to see the code updated to follow the given algorithm now that there are a lot more relations being used. ..Steve ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
[mkgmap-dev] Understanding the sea
Hi, I'm trying to understand how the --generate-sea stuff works. I want to know how it decides whether an island is water or land. The code does not really contain sufficient comments for me to work out what it's doing. I would expect it to close coastline segments that reach the tile boundary in a direction that is consistent with the water on the right convention but I can't see that in the code. Can anyone help please? I hesitate to whine about contributions to mkgmap as I don't want to stop them arriving but if we can't easily work out how the code works then it doesn't bode well for maintenance and bug fixing when the original author has moved on. I have agreed to help produce a marine map of the Baltic so it would be really nice if the sea was filled in without any really major problems (flooded land, etc.) I realise that this is dependent on the performance of the MP stuff but it seems to me that generating the right polygons in the first place would be a good start. I guess that the Baltic area is probably rather a challenge for the current state of the art. Thanks, Mark ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] Understanding the sea
On Dec 28, 2009, at 19:54, Mark Burton wrote: I have agreed to help produce a marine map of the Baltic so it would be really nice if the sea was filled in without any really major problems (flooded land, etc.) I, unfortunately, can't help you specifically with the generate sea stuff. I can only comment that my previous tests with this option were not particularly satisfactory. Since distinguishing land from water seems to be an important feature of marine maps, I wonder if it makes sense to generate a one-off sea layer using cGPSmapper instead of mkgmap, until the generate sea problems are resolved? Or do most marine units have a sufficiently detailed base map? In that case a transparent OSM map (with POIs and other features) might be more appropriate, as this could be layered over the base sea map. Cheers. ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] Understanding the sea
On 28.12.2009 23:22, Clinton Gladstone wrote: On Dec 28, 2009, at 21:27, Felix Hartmann wrote: cgpsmapper produced maps may not be used CCBYSA 2.0 (only non commercial). It would probably nevertheless be best to create a layered sea map instead of creating it each time. Yes, that's true regarding the license. I suppose it would still be possible to generate the sea polygons from another (public domain) source and distribute the sea layer separately from the OSM layer, but that's a hassle both for the person generating the map, and users of the map. Cheers. Well I don't see anyhow why cgpsmapper should be able to correctly render them. Anyhow the most convenient would be to have static osm sea only files, which are in such a format that mkgmap can use them easily. Then it would be just a matter of adding for each country the respective sea data (static) in osm format. ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev