bitmasks for garmin vehicle types

Hi programmers, I don't know why, but Garmin uses slightly different bitmasks for vehicles in restrictions and roads. (mkgmap:car, mkgmap:taxi, ...) The current code sometimes uses these hard to understand bitmasks (e.g. RoadDef.tabAAccess, RouteRestriction.exceptMask) sometimes more or less similar arrays or lists like StyledConverter.ACCESS_TAGS or RoadMerger.mergeTagsNotBool I'd prefer to use one internal format for these 8 types and only translate them to the Garmin format when the data is written to the img file. This could be a single byte field which is filled after style processing, the corresponding tags in ways would be obsolete after that. A new class Vehicle could translate tags to bits in this byte and vice versa, a toString() method would make debugging easier. How does that sound to you? Gerd

On 31/03/14 07:56, Gerd Petermann wrote:
I'd prefer to use one internal format for these 8 types and only translate them to the Garmin format when the data is written to the img file.
Yes agreed, sounds like a great idea
..Steve
+1 for all things that make the code better understandable and less side effect prone! (sounds like +2 ;-) WanMil

WanMil wrote
On 31/03/14 07:56, Gerd Petermann wrote:
I'd prefer to use one internal format for these 8 types and only translate them to the Garmin format when the data is written to the img file.
Yes agreed, sounds like a great idea
..Steve
+1 for all things that make the code better understandable and less side effect prone! (sounds like +2 ;-)
Good. I have a few more things to do in the via_ways branch. I think when this is done I'll invest a few days for refactoring. Or maybe better wait until also the sort2 branch is merged into trunk. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/bitmasks-for-garmin-vehicle-types-tp5801691p5... Sent from the Mkgmap Development mailing list archive at Nabble.com.
participants (4)
-
Gerd Petermann
-
GerdP
-
Steve Ratcliffe
-
WanMil