On Wed, 24 Mar 2010 14:33:15 +0000
Toby Speight <t.m.speight...@cantab.net> wrote:

> When --generate-coastline=multipolygon fails, I'm left with a map that
> has no distinction between land and sea.  However, if I don't
> use --generate-coastline, I at least get a line (from my style/lines).
> Is there any good reason why generating coastline prevents the line
> rules from being applied to the coastline ways?
> 
> It's not a problem when I actually get sea tiles, but it's a serious
> nuisance when small islands have completely disappeared!
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Perhaps this does what you want?

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 0b150ef..8d40da2 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
@@ -531,8 +531,9 @@ public class Osm5XmlHandler extends DefaultHandler {
                                        String natural = 
currentWay.getTag("natural");
                                        if(natural != null) {
                                                if("coastline".equals(natural)) 
{
-                                                       
currentWay.deleteTag("natural");
-                                                       
shoreline.add(currentWay);
+                                                       Way w = 
currentWay.copy();
+                                                       w.deleteTag("natural");
+                                                       shoreline.add(w);
                                                }
                                                else if(natural.contains(";")) {
                                                        // cope with compound 
tag value
@@ -547,10 +548,11 @@ public class Osm5XmlHandler extends DefaultHandler {
                                                                        others 
+= ";" + n;
                                                        }
                                                        if(foundCoastline) {
-                                                               
currentWay.deleteTag("natural");
+                                                               Way w = 
currentWay.copy();
+                                                               
w.deleteTag("natural");
                                                                if(others != 
null)
-                                                                       
currentWay.addTag("natural", others);
-                                                               
shoreline.add(currentWay);
+                                                                       
w.addTag("natural", others);
+                                                               
shoreline.add(w);
                                                        }
                                                }
                                        }
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to