Skip to content

Inspect graph properties #285

Closed
Closed

Description

@devemux86

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?

Activity

  1. devemux86 commented on Nov 9, 2014

    @devemux86
    ContributorAuthor

    If we don't initialize properly the GraphHopper then 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:

  2. karussell commented on Feb 23, 2015

    @karussell
    Member

    Partially we already do this now via public static EncodingManager create( String ghLoc )

  3. devemux86 commented on Feb 23, 2015

    @devemux86
    ContributorAuthor

    Yes that's called from GraphHopper.load which 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.

  4. karussell commented on Feb 23, 2015

    @karussell
    Member

    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?

  5. devemux86 commented on Feb 23, 2015

    @devemux86
    ContributorAuthor

    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!

  6. karussell commented on Feb 23, 2015

    @karussell
    Member

    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.

  7. karussell commented on Oct 5, 2020

    @karussell
    Member

    @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.

  8. devemux86 commented on Oct 5, 2020

    @devemux86
    ContributorAuthor

    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).

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions