Skip to content

Remove everything related to CH from GraphHopperStorage #2388

Closed

Description

@easbar

We currently create CHGraphs in a rather strange way:

FlagEncoder encoder = new CarFlagEncoder();
EncodingManager encodingManager = EncodingManager.create(encoder);
Weighting fastestWeighting = new FastestWeighting(encoder);
CHConfig chConfig = CHConfig.nodeBased("car", weighting);
GraphHopperStorage ghStorage = new GraphBuilder(encodingManager).addCHConfig(chConfig).create();
CHGraph chGraph = ghStorage.getCHGraph("car");

GraphHopperStorage is not really related to CH though. All it really does is holding a reference to the CHGraphs and writing

put("shortcuts.version", Constants.VERSION_SHORTCUT);
properties.put("graph.ch.profiles", chProfileNames.toString()); 

to the properties file. Other than that it just forwards everything to BaseGraph.

So all we really need is a Map<String, RoutingCHGraph> somewhere. Maybe we could use a small class that has this map and manages the properties file. It is definitely unrelated to all the BaseGraph-like code in GraphHopperStorage. The shortcuts.version could probably just be included in the header of the shortcuts DataAccess.

Activity

  1. easbar commented on Nov 23, 2021

    @easbar
    MemberAuthor

    The shortcuts.version could probably just be included in the header of the shortcuts DataAccess.

    This was done in #2436

    So all we really need is a Map<String, RoutingCHGraph> somewhere.

    This was done in b720b6d

    Not exactly sure how to continue yet. Either try to remove CH stuff from GraphHopperStorage (it will be just the base graph + properties then), or make BaseGraph public and remove GraphHopperStorage entirely. But not sure what to do with the properties file yet. However, the first thing I'd like to achieve is getting rid of this constraint that forces us to add CH configs/graphs to GraphHopperStorage before using them (basically #2453).

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