Skip to content

Custom ORS Server Configuration Not Working in PyVroom 1.14.0 #117

@denis-rodriguez

Description

@denis-rodriguez

Issue: Custom ORS Server Configuration Not Working in PyVroom 1.14.0

Description

First, I want to thank the vroom-project community for the excellent work on this project.

However, I’ve encountered an issue when trying to configure a custom ORS (OpenRouteService) server in version pyvroom==1.14.0. The setup does not appear to work as expected, and the application does not connect to the specified server. Using the same code with the previous version, pyvroom==1.13.6, the configuration works perfectly, and the connection to the custom ORS server is successful.

I believe this issue may be related to the change introduced in vroom version 1.14.0: (ORS: (previously) hard-coded /ors/v2 slug now has to be added to the path using -a (#1036)). This adjustment may affect the way custom ORS servers are defined and accessed.

I also tried adding /ors/v2 manually to the server host path, as suggested by the change in version 1.14.0, but the setup still did not work as expected.

Steps to Reproduce

  1. Install pyvroom version 1.14.0:

    pip install pyvroom==1.14.0
  2. Run the following code to configure a custom ORS server:

    import vroom
    
    PORT = "8080"
    ORS_IP = 'my_ip'
    problem_instance = vroom.Input(
        router=vroom._vroom.ROUTER.ORS,
        servers={
            "driving-car": vroom._vroom.Server(host=f"{ORS_IP}/ors/v2", port=PORT)  # Attempted to add /ors/v2
        }
    )
    
    problem_instance.add_vehicle([
        vroom.Vehicle(47, start=(4.680125845580168, -74.05976371858429), end=(4.677730595321412, -74.05362682452656), profile="driving-car"),
        vroom.Vehicle(48, start=(4.680125845580168, -74.05976371858429), end=(4.677730595321412, -74.05362682452656), profile="driving-car")
    ])
    
    problem_instance.add_job([
        vroom.Job(1414, location=(4.687613233940918, -74.10073339593728)),
        vroom.Job(1515, location=(4.704355047101732, -74.0500361180842)),
        vroom.Job(1616, location=(4.702243489218623, -74.04473938756222)),
        vroom.Job(1717, location=(4.705259998520047, -74.06244560102137))
    ])
    
    solution = problem_instance.solve(exploration_level=5, nb_threads=4)
    print(solution.to_dict())
  3. Note that in version pyvroom==1.14.0, even with the /ors/v2 path added, the code does not connect to the custom ORS server. However, when switching to version pyvroom==1.13.6, the same code works correctly without this modification.

Additional Information

  • Python version: 3.10
  • Environment: Google Colab (using default configurations)

Comments

Any assistance or guidance on resolving this issue would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions