bmwcarit / barefoot

Java map matching library for integrating the map into software and services with state-of-the-art online and offline map matching that can be used stand-alone and in the cloud.
Apache License 2.0
665 stars 186 forks source link

Road types config file #97

Closed shuangxia closed 6 years ago

shuangxia commented 6 years ago

Hi, thanks again for your work. I've got it working but just have one question about the road types config. You mentioned in the answer to another issue that the config is used at two points. One of them is define the default value of the road attributes. I wonder if that means, for instance, if one 'trunk' in the osm extract has no speed limit, then the max speed limit for this road will be set to the value defined for road type 'trunk' in the config, say '100'? I also noticed that in function maxspeed() https://github.com/bmwcarit/barefoot/blob/master/map/tools/bfmap.py#L133 you commented out # maxspeed_forward = int(config[key][value][2]), instead you have null for this value. Does it mean now the maxspeed in the config file is not used for default value anymore?

Thank you!

smattheis commented 6 years ago

I wonder if that means, for instance, if one 'trunk' in the osm extract has no speed limit, then the max speed limit for this road will be set to the value defined for road type 'trunk' in the config, say '100'?

That's exactly correct.

Does it mean now the maxspeed in the config file is not used for default value anymore?

That's partially right/wrong. The default values of the road type config are not used during import of OSM data into the database but later when loading the map from the database into the matcher. Therefore, roads with undefined speed values are stored in the database with null values to be distinguishable from roads with OSM-defined speed values. Otherwise, changing default speed values to roads with undefined speed values would require a new setup of the complete database. Nevertheless, during import into the database we use the road type config to select the set of road types that we want to import. In conclusions: The road types config is used (1) during import from OSM data into the database to select the road types (2) when loading the map from the database into the matcher to assign default values.

shuangxia commented 6 years ago

Thanks a lot, the answer is very clear.

smattheis commented 6 years ago

Easy, the question was very clear. :)