Loading custom_areas.directory

Hello guys! How is it going? :slight_smile:

I have a directory with a bunch of geojsons, and I want to make them available in the custom model profiles using the prefix in_<area>. I saw there is the property custom_areas.directory. Does it work to pass the system property in this way -Ddw.graphhopper.custom_areas.directory ?

For me it is not working, Graphhopper complaints about the name of the zone, like if it was not taking care of the system property -Ddw.grapphopper.custom_areas.directory

Any idea or help?

Uh, yeah, this is confusing :smiley: … the custom_areas (currently) have not much to do with the areas in a custom_model. But probably it is time to change this :slight_smile:

See this issue https://github.com/graphhopper/graphhopper/issues/2037

Cool, thanks! I would suggest following an approach like this or similar, in order to have some coherency with how is implemented custom_model_folder

profiles:
    - name: my_custom_car
      vehicle: car
      weighting: custom
      turn_costs: true
      u_turn_costs: 20
      custom_areas_folder: <the path to your geojsons>
      custom_model_file: custom_car.json

Thanks guys for your effort in this tool :+1:

We already have the top-level graphhopper.custom_model_folder configuration property, because resolving paths relative to the location of the config.yml file seems hard: Add custom_model_folder configuration option, extract method · graphhopper/graphhopper@bd52247 · GitHub. Note that custom_model_file can only be a file name, not a path that includes slashes.

So I think we should either add graphhopper.custom_areas_folder next to graphhopper.custom_model_folder, or just allow referencing area definition files that are located in the custom_model_folder we already have. Probably the latter should be enough. We don’t really need to be able to use different custom_area_folders for different profiles, do we? Not sure if there should be one file per area, all areas should be in the same file or if multiple area files with potentially multiple areas per file should be allowed. Maybe just one file per area?

:+1:

Powered by Discourse