There are a few restriction relations for "no through route" mapped in Finland. These are a bit ambiguous, because it looks like there are multiple possible routes, all of which are banned. These relations are tagged with type=restriction, but not with any restriction=*.

For mkgmap, the issue is that multiple warnings get emitted for the single relation. The attached patch would emit just one warning, for the restriction=* being missing. OK to commit?

(Side note: I think that it could be better if there was a "factory" method that created the RestrictionRelation if it is supported. It seems to be a waste of memory to create a RestrictionRelation object that we do not support, for example when there are via ways instead of via nodes.)

While working on this, I was wondering why we set rel=null if turn restrictions are being ignored. I think that the relation should be collected, just like any relation that does not have any magic meaning, so that any style rules could process the relation. I did not touch that part of the code.

Best regards,

        Marko
Index: src/uk/me/parabola/mkgmap/reader/osm/ElementSaver.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/ElementSaver.java	(revision 2916)
+++ src/uk/me/parabola/mkgmap/reader/osm/ElementSaver.java	(working copy)
@@ -144,6 +144,8 @@
 			} else if("restriction".equals(type)) {
 				if (ignoreTurnRestrictions)
 					rel = null;
+				else if (rel.getTag("restriction") == null)
+					log.warn("ignoring unspecified restriction " + rel.toBrowseURL());
 				else
 					rel = new RestrictionRelation(rel);
 			}
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to