Skip to content

Custom Routing is not exported to gpx #2635

Closed

Description

@paulklie

Describe the bug
On https://graphhopper.com/maps/ if a route is planned with a custom weighting, the gpx that is created with the "export" button does not use this weighting but instead uses the default, resulting in a different output.

To Reproduce

Steps to reproduce the behavior. For examples:

  1. open https://graphhopper.com/maps/?point=51.534083%2C8.703704&point=51.561865%2C8.716686&locale=en-NZ&elevation=true&profile=car&use_miles=false&selected_detail=distance&layer=Omniscale
  2. click custom and enter {"priority": [{"if": "road_class == MOTORWAY","multiply_by": "0"}]}
  3. Click export

Expected behavior
The exported gpx and the displayed route are identical

Activity

  1. easbar commented on Jul 26, 2022

    @easbar
    Member

    Thanks for reporting, this is ugly indeed.
    The problem might be that GPX is only supported for GET /route and custom models are only supported for POST /route. So probably we should stop using the server-side GPX functionality and simply convert the route response to GPX when clicking the button, rather than creating a new URL and requesting the route again in GPX format? This would also work for GH maps 2 (http://github.com/graphhopper/graphhopper-maps) where the GPX export is missing so far and we always use the POST endpoint.

  2. karussell commented on Jul 26, 2022

    @karussell
    Member

    Yes, client-side GPX creation is indeed the best solution. (And for GH Maps 2 we create alternative routes for which we also do no have a server-side GPX solution.)

    So probably we should close here and refer to graphhopper/graphhopper-maps#18 :) ?

  3. easbar commented on Jul 28, 2022

    @easbar
    Member

    Yes if somebody (@paulklie maybe?) provides a fix we could include it, but I don't feel like fixing this for the current maps app and I agree it would be more useful to push forward maps 2. Maybe we should disable the gpx button when the custom model box is open to avoid further confusion.

  4. added a commit that references this issue on Dec 1, 2022
    64acc41
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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions