You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use nv-i18n to replace graphhoppers Country enum #1709
I know that the number of constants are problematic if we would use the default EnumEncodedValue to store it. My suggestion would be to create a FilteredEnumEncodedValue class which would allow us to only store a subset of relevant values.
My ultimate goal would be to define relevant countries in the config file and only encode the selected ones in the graph.
The overall plan would be to gather toll mileage on a per country basis for a given route.
eg: Vehicle x drives from Germany to Croatia and i want to know how many kilometers include general/hgv toll.
For this to work i'd have to store the country of every edge with the ability to do this on a global scale(195 countries). And i think that it's much easier to have a curated list which is actively developed and used across many projects.
I was looking at the SpatialRuleParser which already does 99% of the work AFAIK. I could use the countrycodes and shapes from the spatial rules file and encode the country association as an UnsignedIntEncodedValue but maybe it would be better to establish the concept of "country rules" as such? eg have a typesafe enum with all countries, assign them to edges within a countries boundaries and be able write rules without resorting to String keys or index based lookup.
btw why is the SpatialRuleParser using an EnumEncodedValue only to store the index number with setInt()?
Activity
karussell commentedon Sep 3, 2019
Why would this be required? What benefits over 2 letter isocodes do you see?
otbutz commentedon Sep 3, 2019
The overall plan would be to gather toll mileage on a per country basis for a given route.
eg: Vehicle x drives from Germany to Croatia and i want to know how many kilometers include general/hgv toll.
For this to work i'd have to store the country of every edge with the ability to do this on a global scale(195 countries). And i think that it's much easier to have a curated list which is actively developed and used across many projects.
karussell commentedon Sep 3, 2019
Why not e.g. Locale.getISOCountries() or only the countries where we have rules for like we do it for TranslationMap?
otbutz commentedon Sep 3, 2019
I was looking at the SpatialRuleParser which already does 99% of the work AFAIK. I could use the countrycodes and shapes from the spatial rules file and encode the country association as an
UnsignedIntEncodedValuebut maybe it would be better to establish the concept of "country rules" as such? eg have a typesafe enum with all countries, assign them to edges within a countries boundaries and be able write rules without resorting to String keys or index based lookup.btw why is the SpatialRuleParser using an EnumEncodedValue only to store the index number with
setInt()?