[mkgmap-dev] --generate-sea: Flooded islands and MultiPolygonRelation
From Ivan Kostoski ivan.kostoski at gmail.com on Thu Nov 5 16:33:16 GMT 2009
Hello, I found several posible problems why MuliPolygonRelation produces flooded islands. 1. Inner ways are added to outer in order they come from osm data. If you add natural=sea to lines instead of polygons you will get the idea why this is possible problem. Should allways first add the closest inner way to outer way and repeat until there no more inner ways. This will prevent lines running over allready added landmass and self-intersecting outer polygon. 2. Winding of inner ways. If inner way has different winding (i.e. counter-clockwise) to the outer way, you will get self-intersecting polygon as InsertPoints in MultiPolygonRelation does not take care of this. Reversing the coastline way should hopefully have no other impact. 3. Adding the last point of inner way (which should (?) be the same as the first) I attached modified MultiPolygonRelation.java (from r1340), however I have very very limited Java skills so this needs a complete rework as it is painfully (unusably) slow (i.e. calculating the closest way over and over again). My tests with this modification reduced number of flooded islands (i.e. on Croatian coastline) at least when zoomed in. Some islands still get flooded when zooming out. I am not able to find out why this happens, but some islands notriously like to flood more than others (i.e. OSM id 8838012) .. Actually, usually it is a whole chain that gets 'cut off' from the land-mass. If one island gets 'flooded', all islands linked to it also get flooded, i.e. polygon is broken... This might or might not have to do something with the polygon splitter. I think the proper way of solving this might be the polygon splitter as in that case we might be able to add points without delta shift which will reduce artifacts (linking lines). Or maybe it would be much easier to simply add the islands as i.e. natural=land without subtracting them from the sea polygon and draw over the sea (via .typ polygon draw-order) ? Hope this is useful and somebody more skilled will be able to address above issues. Thanks, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20091105/02affd90/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: MultiPolygonRelation.java Type: application/octet-stream Size: 7313 bytes Desc: not available Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20091105/02affd90/attachment.obj
- Previous message: [mkgmap-dev] indexing stuff
- Next message: [mkgmap-dev] some bad routing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list