abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
510 stars 122 forks source link

Value "official" is not recognised #84

Closed MaartenDeen closed 7 years ago

MaartenDeen commented 7 years ago

There is an official value that can be used for access tagging. Brouter does not recognise this value in the profile. It gives an error: "Profile error: ParseException at line 10: unknown lookup value: official" with this profile: ---context:global # following code refers to global config assign consider_elevation 0

---context:way # following code refers to way-tags assign turncost 0 assign initialcost 0

assign costfactor

switch bicycle=official 1.0 10.0

---context:node # following code refers to node tags assign initialcost 0

poutnikl commented 7 years ago

BRouter intentionally does not recognize all tag values. Tags and tagvlaues available in RD5 data files are listed in lookups.dat file. All tag=tagvalues combinations not listed in lookups.dat file trigger an error.

The profiles usually consider just subset off all available tagvalues for the given tag in lookups.dat. There is often used a default value approach, used in case if the tag value is defined, but does not match any of explicitly evaluated values.

For access like tags, the default access is taken as granted , unless there are explicit forbidding tagvalues. so explicitly considering bicycle=official would not make a real difference.

MaartenDeen commented 7 years ago

I disagree with that last statement. In Germany I see taggings like highway=path, surface=asphalt, bicycle=official to designate a compulsory bicycle path. With the standard fastbike profile this gets a costfactor of 2.0 (triggerd by highway=path, surface=asphalt), considerably higher than a parallel primary or secondary road, so brouter does not route over the bicycle path. I don't know if the tagging I mentioned is something new by the german community (the wiki page is not) but I used to see highway=path, surface=asphalt, bicycle=designated. And since brouter recognises designated, you can use that to make correct routings. So since this appears to be a very valid way of tagging (and I'm sure I would piss people off by changing bicycle=official to bicycle=designated just for routing), I would really appreciate it if =official would be added to the lookup file.

zossebart commented 7 years ago

bicycle=official is in fact already in the routing data for the way context, it is just aliased to the value "designated" (see lookups.dat)

poutnikl commented 7 years ago

According to wiki, for compulsory use, bicycle=designated and bicycle=use_sidepath should be used, even if in Germany there is a custom to use official. As being compulsory is the implied, not intended meaning of tagvalue offiicial.

poutnikl commented 7 years ago

@zossebart : Thanks, I did not check.

@MaartenDeen There is a general approach to the lookups.dat tag - tagvalue rows, that the values on given rows are in BRouter context considered as synonyms/aliases, but only the first item can be used in profiles. Internally, all listed tagvalues are coded by the same code in RD5 files, being referred by the first listed value among the synonyms.

Any time you are going to use bicycle=official in a profile, use bicycle=designated. If you write such a profile, that grants costfactor 1.0 to all bicycle=designated roads, it automatically grants the same to bicycle=official. But without usage of bicycle=use_sidepath it is often not enough.

MaartenDeen commented 7 years ago

Ok, I understand that.

abrensch commented 7 years ago

Question seems answerd...