I've comitted a fix to the UnusedElementsRemoverHook so it should work
again.
Thanks for the good report!!
WanMil
Thanks all for tracking that down.
I can confirm that.
The problem is the new UnusedElementsRemoverHook which removes all
elements that are outside the tile. Unfortunately it also removes the
sea polygon which is one point bigger than the bounding box. I will
think about how to fix that but it should not be too complicated.
WanMil
On 18/02/2012 01:02, WanMil wrote:
Hi Charlie,
I have no idea yet.
I think there are only two commits that may be relevant:
r2163 and r2168.
It would be great if you can retry with r2163 to narrow down the
problem. You might also upload the OSM data of your tile so that I or
someone else can do some debugging to find the problem.
WanMil
tp://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Hey WanMil,
The problem was introduced by mkgmap r2163 (thanks to Sterol Andro for
the individual jar files). r2162 compiles fine with sea visible; r2163
shows the no sea problem described earlier when the
--generate-sea:polygons option is used.
I guess the preprocessing introduced by r2163 is somehow removing
something that the --generate-sea:polygons algorithm depends on.
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Index: src/uk/me/parabola/mkgmap/reader/osm/UnusedElementsRemoverHook.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/UnusedElementsRemoverHook.java (revision 2207)
+++ src/uk/me/parabola/mkgmap/reader/osm/UnusedElementsRemoverHook.java (working copy)
@@ -132,6 +132,17 @@
// check if the way is completely outside the tile bounding box
boolean coordInBbox = false;
Coord prevC = null;
+
+ // It is possible that the way is larger than the bounding box and therefore
+ // contains the bbox completely. Espacially this is true for the sea polygon
+ // when using --generate-sea=polygon
+ // So need the calc the bbox of the way
+ Coord firstC = way.getPoints().get(0);
+ int minLat = firstC.getLatitude();
+ int maxLat = firstC.getLatitude();
+ int minLong = firstC.getLongitude();
+ int maxLong = firstC.getLongitude();
+
for (Coord c : way.getPoints()) {
if (bbox.contains(c)) {
coordInBbox = true;
@@ -148,10 +159,29 @@
break;
}
}
+
+ if (minLat > c.getLatitude()) {
+ minLat = c.getLatitude();
+ } else if (maxLat < c.getLatitude()) {
+ maxLat = c.getLatitude();
+ }
+ if (minLong > c.getLongitude()) {
+ minLong = c.getLongitude();
+ } else if (maxLong < c.getLongitude()) {
+ maxLong = c.getLongitude();
+ }
+
prevC = c;
}
if (coordInBbox==false) {
- saver.getWays().remove(way.getId());
+ // no coord of the way is within the bounding box
+ // check if the way may completely contains the bounding box
+ Area wayBbox = new Area(minLat, minLong, maxLat, maxLong);
+ if (wayBbox.intersects(saver.getBoundingBox())) {
+ log.debug(way, "may completely contain the bbox. Keep it.", way.toTagString());
+ } else {
+ saver.getWays().remove(way.getId());
+ }
}
}
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev