Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve picking up default graph #1876

Merged
merged 5 commits into from
Jan 30, 2020
Merged

Improve picking up default graph #1876

merged 5 commits into from
Jan 30, 2020

Conversation

karussell
Copy link
Member

@karussell karussell commented Jan 28, 2020

fixes #1862

Done:

  • RouteNetwork.EV_SUFFIX is replaced via the simpler RouteNetwork.key() method that enforces the parameter. Same for TurnCost.EV_SUFFIX.
  • Made bike_network a shared EncodedValue (before it was in bike namespace and associated to a specific bike encoder which does not make much sense as it is valid for all BikeFlagEncoders)
  • force separating shared encoded values (come first) and encoded values of FlagEncoders (later)
  • default config.yml is now loadable via new GraphHopper().load(graph-cache)
  • bug fix in PathTest that used the wrong encoder
  • bug fix in EnumEncodedValue that calculated the size wrong and wasted a bit space

@karussell karussell changed the title WIP: improve picking up default graph Improve picking up default graph Jan 28, 2020
@karussell karussell added the bug label Jan 28, 2020
@karussell karussell added this to the 1.0 milestone Jan 28, 2020
@easbar
Copy link
Member

easbar commented Jan 29, 2020

default config.yml is now loadable via new GraphHopper().load(loc)

What does that mean? I can do new GraphHopper().load("/path/to/config.yml")?

@karussell
Copy link
Member Author

karussell commented Jan 29, 2020

It means that when you do an import with the default config.yml (or with CH disabled) the Java code new GraphHopper().load("/path/to/graph-cache") loads without problems, see #1862. I.e. our Android code loads a graph that was prepared on the desktop with the default config.yml.

There are two 'fighting' things:

  • we automatically add e.g. the encoded value get_off_bike if there is any BikeFlagEncoder
  • we store shared encoded values like max_speed first, then flag encoders with their namespaced encoded values like bike.access

The error happened only flag_encoders=car,bike: before this PR the "automatic addition" was done in the while loop of the flag encoders i.e. on import get_off_bike was added after car.access and car.average_speed but on GraphHopper.load we added get_off_bike before all flag encoders leading to a different shift of the encoded value and it failed to load.

Of course it is possible to load the encoded value 'as it', i.e. with all the known shift and bits values, and then we could load arbitrary configured GraphHopper installations, but this is for another issue and not that easy. (And the plan is to get rid of the FlagEncoders before)

@develar
Copy link

develar commented Mar 6, 2020

Just want to say thanks again for a quick fix — as part of asamm/locus-addon-graphhopper#6 I removed bunch of code in application and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initialization with example config should work like the default Java settings
3 participants