In removeWaysOutsideBox(), exactly one way gets removed
but that is enough to completely remove the sea.
The way that is removed is exactly one unit outside the bounding box
on all four corners. It is thus removed because no point is actually
inside the bounding box, even though it completely surrounds the
bounding box.
Ouch... This check is missing.
Attached patch does not remove ways that completely contain the bounding
box.
WanMil
Index: src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
(revision 1563)
+++ src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
(working copy)
@@ -399,6 +399,16 @@
}
if (remove) {
+ // check if the polygon contains the complete
bounding box
+ Rectangle bboxRect = new
Rectangle(bbox.getMinLong(), bbox
+ .getMinLat(), bbox.getMaxLong()
- bbox.getMinLong(),
+ bbox.getMaxLat() -
bbox.getMinLat());
+ if (w.getBounds().contains(bboxRect)) {
+ remove = false;
+ }
+ }
+
+ if (remove) {
if (log.isDebugEnabled()) {
log.debug("Remove way", w.getId(),
"because it is completely
outside the bounding box.");
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev