Skip to content

exception in landmark preparation #2020

Closed

Description

@karussell

The problem is since we allowed multiple rules. See #1903 (comment)

The stacktrace is:

Caused by: java.lang.IndexOutOfBoundsException: Index: 0
        at java.util.Collections$EmptyList.get(Collections.java:4456)
        at java.util.Collections$UnmodifiableList.get(Collections.java:1311)
        at com.graphhopper.routing.lm.LandmarkStorage.findBorderEdgeIds(LandmarkStorage.java:467)
        at com.graphhopper.routing.lm.LandmarkStorage.createLandmarks(LandmarkStorage.java:263)

So, we probably need some test code to cover this scenario too. @otbutz do you have an idea what could go wrong and why we expected this not to happen for landmarks? Should we just do:

SpatialRuleSet set = ruleLookup.lookupRules(nodeAccess.getLatitude(adjNode), nodeAccess.getLongitude(adjNode));
SpatialRule ruleAdj = set.getRules().isEmpty() ? null : set.getRules().get(0);

int baseNode = allEdgesIterator.getBaseNode();
set = ruleLookup.lookupRules(nodeAccess.getLatitude(baseNode), nodeAccess.getLongitude(baseNode));
SpatialRule ruleBase = set.getRules().isEmpty() ? null : set.getRules().get(0);
...

?

Activity

  1. added this to the 1.0 milestone on Apr 27, 2020
  2. otbutz commented on Apr 27, 2020

    @otbutz
    Contributor

    That should fix it. I was under the impression that the landmark areas file would cover the whole globe and therefor yield an applicable ID for each point.

    mapgeojson

  3. karussell commented on Apr 27, 2020

    @karussell
    MemberAuthor

    Ok, thanks for confirmation. Yes, we could provide one globally, but should still prepare for the general (user provided) case and approach this more defensive.

  4. otbutz commented on Apr 28, 2020

    @otbutz
    Contributor

    Would it be worth to take a look at the current area definitions in order to improve landmark based routing?

  5. karussell commented on Apr 28, 2020

    @karussell
    MemberAuthor

    What do you mean? The area splitting makes it impossible to route between the defined areas but improves speed within the areas significantly, so further reducing the area might not be of much use.

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions