Good catch! :-)

Please try the patch if your warnings disappear.

WanMil

Am 05.11.2010 08:50, schrieb Marko Mäkelä:
On Thu, Nov 04, 2010 at 11:04:24PM +0100, WanMil wrote:
I haven't checked the mp warnings for long but I think most of the
warnings are "real" warnings now.

These ones look bogus. QLandkarte shows the islands on the map (on the
north neighbour of tile 63240003), and they are nowhere near the tile
border:

63240003: 2822016,1172416 to 2916352,1462272
#       : 60.553894,25.157318 to 62.578125,31.376953
or according to splitter.jar:
63240003 (60.55389404296875,25.157318115234375) to (62.578125,31.376953125)

2010/11/05 09:07:59 WARNING (MultiPolygonRelation): 63240003.osm.gz:
Cannot join the following ways to closed polygons. Multipolygon
http://www.openstreetmap.org/browse/relation/900367
2010/11/05 09:07:59 WARNING (MultiPolygonRelation): 63240003.osm.gz: -
way: http://www.openstreetmap.org/browse/way/26228147

2010/11/05 09:07:36 WARNING (MultiPolygonRelation): 63240003.osm.gz:
Cannot join the following ways to closed polygons. Multipolygon
http://www.openstreetmap.org/browse/relation/302872
2010/11/05 09:07:36 WARNING (MultiPolygonRelation): 63240003.osm.gz: -
way: http://www.openstreetmap.org/browse/way/27525696

Both ways are completely outside the bounding box of tile 63240003. For
example, the southmost point of way 27525696 is
http://www.openstreetmap.org/?lat=62.61975&lon=26.55375&zoom=18
and you see, 62.61975>  62.578125.

Could you eliminate these bogus warnings, WanMil?

        Marko
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Index: src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java	(revision 1727)
+++ src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java	(working copy)
@@ -441,24 +441,30 @@
 	 */
 	private void removeUnclosedWays(ArrayList<JoinedWay> wayList) {
 		Iterator<JoinedWay> it = wayList.iterator();
-		boolean first = true;
+		boolean firstWarn = true;
 		while (it.hasNext()) {
 			JoinedWay tempWay = it.next();
 			if (!tempWay.isClosed()) {
-				if (first) {
-					log.warn(
-						"Cannot join the following ways to closed polygons. Multipolygon",
-						toBrowseURL());
+				// warn only if the way intersects the bounding box 
+				boolean inBbox = tempWay.intersects(bbox);
+				if (inBbox) {
+					if (firstWarn) {
+						log.warn(
+							"Cannot join the following ways to closed polygons. Multipolygon",
+							toBrowseURL());
+						firstWarn = false;
+					}
+					logWayURLs(Level.WARNING, "- way:", tempWay);
 				}
-				logWayURLs(Level.WARNING, "- way:", tempWay);
 
 				it.remove();
-				first = false;
 				
-				String role = getRole(tempWay);
-				if (role == null || "".equals(role) || "outer".equals(role)) {
-					// anyhow add the ways to the list for line tagging
-					outerWaysForLineTagging.addAll(tempWay.getOriginalWays());
+				if (inBbox) {
+					String role = getRole(tempWay);
+					if (role == null || "".equals(role) || "outer".equals(role)) {
+						// anyhow add the ways to the list for line tagging
+						outerWaysForLineTagging.addAll(tempWay.getOriginalWays());
+					}
 				}
 			}
 		}
@@ -1949,6 +1955,10 @@
 			}
 
 		}
+		
+		public boolean intersects(uk.me.parabola.imgfmt.app.Area bbox) {
+			return (maxLat >= bbox.getMinLat() && minLat <= bbox.getMaxLat() && maxLon >= bbox.getMinLong() && minLon <= bbox.getMaxLong());
+		}
 
 		public Rectangle getBounds() {
 			if (bounds == null) {
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to