WanMil schrieb am 24.09.2010 17:35:
The mp code must check if the mp itself contains the
relevant polygon tags or if the tagging should be taken from the outer
ways. For this purpose a list of known polygon tags is used and up to
now leisure is not in this list.

My understanding of the multipolygons is, that the tags may EITHER be in the
relation OR on the outer polygons. So the outerpoylgons are only to be used,
when there are no tags on the relation.
If the relation itself is tagged and there is a tag on the outerpolygons, this
does logical mean, that the outerpolygon tags apply to the complete area
including the inner-area.

There shouldn't be a list of concerned tags, since any area tags may be used.

I agree.
But the real world does not strictly follow this definition. Unfortunately very lots of mps are tagged with some non polygon tags and therefore I introduced the list of well known polygon tags. At least this was neccessary when I implemented the mp code.

You càn check yourself if it's now the time to remove this polygon list. I have attached a patch that follows your proposal. Just test it and let us know.

WanMil


Gruss
Torsten
Index: src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java	(revision 1702)
+++ src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java	(working copy)
@@ -67,13 +67,6 @@
 	private static final double OVERLAP_TOLERANCE_DISTANCE = 2.0d;
 	
 	/**
-	 * if one of these tags are contained in the multipolygon then the outer
-	 * ways use the mp tags instead of their own tags.
-	 */
-	private static final List<String> polygonTags = Arrays.asList("boundary",
-			"natural", "landuse", "land_area", "building", "waterway");
-
-	/**
 	 * Create an instance based on an existing relation. We need to do this
 	 * because the type of the relation is not known until after all its tags
 	 * are read in.
@@ -771,7 +764,7 @@
 			
 			// check if the polygon has tags and therefore should be processed
 			boolean processPolygon = currentPolygon.outer
-					|| hasPolygonTags(currentPolygon.polygon);
+					|| hasTags(currentPolygon.polygon);
 
 			if (processPolygon) {
 				List<Way> singularOuterPolygons;
@@ -798,7 +791,7 @@
 				}
 
 				boolean useRelationTags = currentPolygon.outer
-						&& hasPolygonTags(this);
+						&& hasTags(this);
 				if (useRelationTags) {
 					// the multipolygon contains tags that overwhelm the
 					// tags of the outer polygon
@@ -1374,22 +1367,19 @@
 		return w;
 	}
 
-	private boolean hasPolygonTags(JoinedWay way) {
+	private boolean hasTags(JoinedWay way) {
 		for (Way segment : way.getOriginalWays()) {
-			if (hasPolygonTags(segment)) {
+			if (hasTags(segment)) {
 				return true;
 			}
 		}
 		return false;
 	}
 
-	private boolean hasPolygonTags(Element element) {
+	private boolean hasTags(Element element) {
 		for (Map.Entry<String, String> tagEntry : element.getEntryIteratable()) {
-			if ("natural".equals(tagEntry.getKey()) && "coastline".equals(tagEntry.getValue())) {
-				// ignore natural=coastline because this is not a real polygon tag
-				continue;
-			}
-			if (polygonTags.contains(tagEntry.getKey())) {
+			if ("type".equals(tagEntry.getKey()) == false) {
+				// return true if there is more than one tag other than "type"
 				return true;
 			}
 		}
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to