Skip to content

Rename CH/LM preparations according to their profile name #1999

Closed

Description

@easbar

Having merged #1934 we should now rename the CH graph and landmark files according to their profile names. This way we should also be able to get rid of Weighting#equals and TurnCostProvider#getName (and maybe even Weighting#getName).

Activity

  1. added this to the 1.0 milestone on Apr 18, 2020
  2. easbar commented on Apr 24, 2020

    @easbar
    MemberAuthor

    The CH/LM files were actually already named according to the profile names, but now this is also used in the properties file to 'identify' the CH/LM data. This way we no longer need to to logic using the 'name' of the turn cost provider or the weighting.

    There is a bit of an inconvenience: If we prepare a profile 'xyz', then shut down, change the profile in the config (but not the name) and start again, the profile will no longer match and no re-import will be triggered. One has to remember to call GraphHopper.clean() or otherwise remove the graph data and do a re-import. Previously this was somewhat less likely, because the weighting name, flag encoder und u-turn costs were used to 'identify' the preparation. But obviously even then we would have the same problem with custom profiles.

    Maybe we should introduce some hash code for the profiles to be able to detect these kind of errors?

    Note that this change requires re-importing the graphs (due to the changes in the properties file).

  3. karussell commented on Apr 24, 2020

    @karussell
    Member

    Ah, yes. We do similar hashing for flag encoders and encoded values. It would be only required to do that when a config can be used to load a different graph. (Is this possible?)

    Note that this change requires re-importing the graphs (due to the changes in the properties file).

    Should we enforce this via some version increment in Constants?

  4. easbar commented on Apr 24, 2020

    @easbar
    MemberAuthor

    It would be only required to do that when a config can be used to load a different graph. (Is this possible?)

    Well yes this can happen accidentally like I said if you change the config (but not the name) (something like speed_factor etc.) there will be no re-import, no error and the wrong weighting will be even used with the prepared graph.

    Should we enforce this via some version increment in Constants?

    Ah right I forgot we had this, will do.

  5. easbar commented on Apr 24, 2020

    @easbar
    MemberAuthor

    I increased Constants.VERSION_SHORTCUT, but there does not seem to be a version for landmarks yet?

  6. karussell commented on Apr 24, 2020

    @karussell
    Member

    Ok, then it would be indeed good to have a hash in the storage. Still the java hash is not a good idea. We need a stable one like done in UnsignedIntEncodedValue.staticHashCode, see #1660.

    I increased Constants.VERSION_SHORTCUT, but there does not seem to be a version for landmarks yet?

    Ok. We could introduce one, but not too important as the format rarely changed.

  7. easbar commented on Apr 24, 2020

    @easbar
    MemberAuthor

    Still the java hash is not a good idea.

    Yeah I did not necessarily mean this. I just meant any kind of hash so we can check if the profile has changed compared to the profile that was used for the preparation.

    Ok. We could introduce one, but not too important as the format rarely changed.

    Yes, I was just saying. The reason this does not exist is probably that GHStorage only contains 'graphs' but not the landmark storage. But imo it would be better to have this kind of 'database' that has everything that gets persisted: graphs, ch preparations, turn costs, string index, landmarks, etc.

  8. added a commit that references this issue on Sep 28, 2021
    e99b2e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions