The patch closes all ways having both endpoints on the same side outside
the bounding box. In this case it is not necessary to check if closing
the way intersects the way itself.
This fixes most (but not all) of the outstanding tile splitter problems.
WanMil
Index: src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
(revision 1593)
+++ src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
(working copy)
@@ -325,6 +325,22 @@
}
Coord p1 = way.getPoints().get(0);
Coord p2 = way.getPoints().get(way.getPoints().size() -
1);
+
+ // check if both endpoints are outside the bounding box
+ // and if they are on the same side of the bounding box
+ if ((p1.getLatitude() <= bbox.getMinLat() &&
p2.getLatitude() <= bbox.getMinLat())
+ || (p1.getLatitude() >= bbox.getMaxLat() &&
p2.getLatitude() >= bbox.getMaxLat())
+ || (p1.getLongitude() <= bbox.getMinLong() &&
p2.getLongitude() <= bbox.getMinLong())
+ || (p1.getLongitude() >= bbox.getMaxLong() &&
p2.getLongitude() >= bbox.getMaxLong())) {
+ // they are on the same side outside of the bbox
+ // so just close them without worrying about if
+ // they intersect itself because the
intersection also
+ // is outside the bbox
+ way.closeWayArtificially();
+ log.info("Endpoints of way",way,"are both
outside the bbox. Closing it directly.");
+ continue;
+ }
+
Line2D closingLine = new
Line2D.Float(p1.getLongitude(), p1
.getLatitude(), p2.getLongitude(),
p2.getLatitude());
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev