[PATCH] Do not create RestrictionRelation for unspecified restriction

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

Hi Marko, the patch looks good to me. Typically there are only a few hundred relations in one tile, so I do not expect a big change in performance if we don't create objects for the very few relations that we don't supprt. I think it is ok to ignore the restriction, because we have no other code to interpret it. Gerd Date: Thu, 2 Jan 2014 19:37:28 +0200 From: marko.makela@iki.fi To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] [PATCH] Do not create RestrictionRelation for unspecified restriction 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 _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Gerd, thanks for the review. I will wait a bit before committing to trunk, in case someone has another opinion.
I think it is ok to ignore the restriction, because we have no other code to interpret it.
My point is that there could be a style rule to interpret the type=restriction relation. (Maybe someone wants to create a map layer containing all ways or nodes participating in restrictions.) So, it would seem like a bug to silently discard the type=restriction relation if the built-in processing of it is disabled by a command-line option. But, I guess that we can leave it as is for now. Marko
participants (2)
-
Gerd Petermann
-
Marko Mäkelä