Hi Steve,
> Someone has tagged part of the UK coastline with natural=coastline;cliff and
> this has broken
> --generate-sea=polygons,no-sea-sectors,close-gaps=1000. Is this valid syntax
> that mkgmap should cope with?
The attached patch is a quick workaround.
If possible, please test.
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 f78b1f9..7da3508 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
@@ -517,9 +517,33 @@ public class Osm5XmlHandler extends DefaultHandler {
if("motorway".equals(highway) ||
"trunk".equals(highway))
motorways.add(currentWay);
- if(generateSea && "coastline".equals(currentWay.getTag("natural"))) {
- currentWay.deleteTag("natural");
- shoreline.add(currentWay);
+ if(generateSea) {
+ String natural = currentWay.getTag("natural");
+ if(natural != null) {
+ if("coastline".equals(natural)) {
+ currentWay.deleteTag("natural");
+ shoreline.add(currentWay);
+ }
+ else if(natural.contains(";")) {
+ // cope with compound tag value
+ String others = null;
+ boolean foundCoastline = false;
+ for(String n : natural.split(";")) {
+ if("coastline".equals(n.trim()))
+ foundCoastline = true;
+ else if(others == null)
+ others = n;
+ else
+ others += ";" + n;
+ }
+ if(foundCoastline) {
+ currentWay.deleteTag("natural");
+ if(others != null)
+ currentWay.addTag("natural", others);
+ shoreline.add(currentWay);
+ }
+ }
+ }
}
currentNodeInWay = null;
currentWayStartsWithFIXME = false;
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev