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
Is there a way via the API to inspect a graph's properties prior loading it?
GraphHopper class has to be initialized properly with setCHEnable, setElevation (and now with the turn restrictions too) prior calling load method.
Too many combinations, or else the load will fail.
Right now need to catch these exceptions in order to cover all the cases, but is there a more elegant solution?
I see. So with the 'mobile use case' ... you mean we should put those configs in e.g. the properties and init the GraphHopper instance from this if possible?
I mean that as GraphHopper evolves, it's natural to use more and more properties.
It would be convenient if it could parse the graphs and by inspecting their properties, could open them without exceptions (as it would know itself what parameters to set at loading).
Only case I can imagine we could have any errors would be the advancement of the nodes / edges versions.
Though it would be marvellous if the backwards compatibility would not break too!
Regardiong backwards compatiblity: that will break a lot and we should break it :) ! But we could introduce an automated conversion procedure like lucene is doing.
GraphHopper has changed a lot all these years and that could be done with StorableProperties.
Now with the profiles, it's more intuitive the lib to automatically create and load profiles when open an unknown graph,
instead of read the properties file to create manually the profiles (with missed info since weighting is not in properties).
Activity
devemux86 commentedon Nov 9, 2014
If we don't initialize properly the
GraphHopperthen we come upon loading errors like:Configured dimension (3) is not equal to dimension of loaded graph (2)Cannot load the graph when using instance of com.graphhopper.storage.LevelGraphStorage and location:karussell commentedon Feb 23, 2015
Partially we already do this now via
public static EncodingManager create( String ghLoc )devemux86 commentedon Feb 23, 2015
Yes that's called from
GraphHopper.loadwhich is already been used.The thing is that in order to open an unknown graph we need to try multiple combinations and try/catch the exceptions.
karussell commentedon Feb 23, 2015
I see. So with the 'mobile use case' ... you mean we should put those configs in e.g. the properties and init the
GraphHopperinstance from this if possible?devemux86 commentedon Feb 23, 2015
I mean that as GraphHopper evolves, it's natural to use more and more properties.
It would be convenient if it could parse the graphs and by inspecting their properties, could open them without exceptions (as it would know itself what parameters to set at loading).
Only case I can imagine we could have any errors would be the advancement of the nodes / edges versions.
Though it would be marvellous if the backwards compatibility would not break too!
karussell commentedon Feb 23, 2015
Regardiong backwards compatiblity: that will break a lot and we should break it :) ! But we could introduce an automated conversion procedure like lucene is doing.
karussell commentedon Oct 5, 2020
@devemux86 why did you close that? I think it might be a valuable feature, i.e. loading a graph without configuring the Java objects before.
devemux86 commentedon Oct 5, 2020
GraphHopper has changed a lot all these years and that could be done with
StorableProperties.Now with the profiles, it's more intuitive the lib to automatically create and load profiles when open an unknown graph,
instead of read the properties file to create manually the profiles (with missed info since weighting is not in properties).