Skip to content

Enabling landmarks is not straightforward and for some cases not possible on mobile #1401

Closed

Description

@develar
  1. To enable ch, you just need to call setCHEnabled. For landmarks you have to call setWeightingsAsStrings(Collections.singletonList("fastest")) in addition to gh.getLMFactoryDecorator().setEnabled(true), because opposite to CHAlgoFactoryDecorator (setWeightingsAsStrings(Arrays.asList(getDefaultWeighting()))), LMAlgoFactoryDecorator doesn't have fastest as default value.

  2. Method loadOrPrepareLM on mobile leads to error Writes are not allowed! because if setAllowWrites(false) (Locus add-on does it), error will be thrown even if landmarks is already prepared (no need to set prepare.lm.done=true — it is already set and data prepared).

  3. If I understand correctly, for prepared landmarks algo DIJKSTRA_BI should be used, right? But logic to select default algo if not specified explicitly algoStr = chFactoryDecorator.isEnabled() && !disableCH ? DIJKSTRA_BI : ASTAR_BI is outdated and not correct, right (https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/GraphHopper.java#L1001
    )? Well, I tried to explicitly specify DIJKSTRA_BI and still unacceptable slow.

Without landmarks car routing from Germany to Italy is unacceptable slow (did not wait for results). After

gh.getLMFactoryDecorator().setEnabled(true);
gh.getLMFactoryDecorator().setWeightingsAsStrings(Collections.singletonList("fastest"));
gh.setAllowWrites(true);

on locus add-on side I hope landmarks is enabled, but still routing cannot be finished. e.g. for 600 km bike it is finished in the same time as for car 70 km. And for 600 km car routing time is endless.

In https://www.graphhopper.com/blog/2017/08/14/flexible-routing-15-times-faster/ I see "Still the speed of contraction hierarchies is ~10 times faster on average" and probably it means that you cannot do car routing on mobile with turn restrictions at the moment (sorry, it is off topic here, since I have to discuss about it not in the GitHub issues, but for me not yet clear — will be still so slow when all mentioned bugs will be fixed).

My landmarks: https://s3.eu-central-1.amazonaws.com/gh-routing-data/2018-06-17/we-ce-europe.osm-gh.zip (coverage https://umap.openstreetmap.fr/en/map/europe-region-1-coverage_228183)

Activity

  1. karussell commented on Jun 29, 2018

    @karussell
    Member

    Thanks for writing & finding these issues. Yes, the usage needs to improve!

    Still the speed of contraction hierarchies is ~10 times faster on average" and probably it means that you cannot do car routing on mobile with turn restrictions at the moment

    You can try the experimental branch #1247 and see how it performs in comparison? Any constructive feedback in this early stage would be very helpful.

    If I understand correctly, for prepared landmarks algo DIJKSTRA_BI should be used, right?

    landmark uses bidirectional A*. In fact landmarks is bidir A* with 'just' a different heuristic.

    In general getting feedback from people using GraphHopper on mobile devices is highly appreciated. E.g. loading big files into memory mapped storage is still a huge issue that IMO we can solve only if we go partially native for a special DataAccess object as Android blocks requesting memory mapped files at a certain limit per application on Android.

  2. karussell commented on Jul 30, 2020

    @karussell
    Member

    This should be improved with the refactorings in 1.0 and later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions