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
Rename CH/LM preparations according to their profile name #1999
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).
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).
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?
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?
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.
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.
Activity
Edge-based shortest-path trees (Algorithm only)
easbar commentedon Apr 24, 2020
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).
karussell commentedon Apr 24, 2020
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?)
Should we enforce this via some version increment in Constants?
easbar commentedon Apr 24, 2020
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.
Ah right I forgot we had this, will do.
easbar commentedon Apr 24, 2020
I increased
Constants.VERSION_SHORTCUT, but there does not seem to be a version for landmarks yet?karussell commentedon Apr 24, 2020
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.
Ok. We could introduce one, but not too important as the format rarely changed.
easbar commentedon Apr 24, 2020
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.
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.
Update ios_compatibility branch to graphhopper 1.0 release state. (#2383