However, while the cobblestone surface is available in custom model configuration, it seems that grass_paver isn’t. Yet the grass_paver tag seems to be available in the bad surface mapping of the CarFlagEncoder.
How come there’s this discrepancy? And how would I go about making the grass_paver tag available for custom model configuration? Would you suggest another approach entirely?
EDIT: Actually, no surface tags work: encoded value 'surface' not available. I guess I need to add surface to graph.encoded_values.
EDIT: Point still stands, how come e.g. grass_paver isn’t available? It doesn’t seem to have been deprecated.
Thanks for pointing out the relevant source code - but I wonder if grass_paver being left out is an oversight or due some issue with it. If the former, I guess I might as well open a PR to include it.
I guess that in general, those enums should include all the values listed on the OpenStreetMap wiki page for each corresponding tag key, like the Surface page which includes grass_paver.
the more values we support the more the end user has to support.
If e.g. the Surface enum were to include grass_paver, but the end user doesn’t use it in custom model configuration, what will be the default behaviour? Does Graphhopper maybe treat it like OTHER or perhaps MISSING? Also what does ‘support’ mean specifically in this context?
Also what does ‘support’ mean specifically in this context?
Sorry. This was a bit unclear. If the user needs a change for when “the surface is grass” then the user would need to support such special “sub”-tags too. So it would make more sense to set the value to grass for all grass_* “sub”-tags instead of creating a value for all unique OSM tags. And I guess in your case this would be sufficient too (?)
Add it to DefaultEncodedValueFactory
Add it to DefaultTagParserFactory
There is no need to fork GraphHopper - you can add those encoded values in an application that just uses GraphHopper. You can implement the factory interface and set this in the GraphHopper class, so that it will replace the default factory.
What’s the reasoning behind whether to include tags like hgv?
This sounds useful and no reason to not include it
Are FlagEncoder classes on the way out like @otbutz suggests
And regarding grass_paver: we would certainly accept a PR where this tag is considered while parsing instead of putting it in OTHER (i.e. it would go into grass).