Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A more realistic example with the project #80

Open
bencz opened this issue Jun 29, 2023 · 3 comments
Open

A more realistic example with the project #80

bencz opened this issue Jun 29, 2023 · 3 comments

Comments

@bencz
Copy link

bencz commented Jun 29, 2023

The project is very good, with this binding in python, it makes it simpler to implement rest/grpc APIs to calculate routings.

But I couldn't understand how to use the bind, with information like the ones we use in the vroom C++ version, for example, let's take the following request made to vroom-express:

{
  "jobs": [
    {
      "id": 1,
      "description": "Rue des Binelles, Sèvres",
      "location": [
        2.214431762695313,
        48.82359296752074
      ]
    },
    {
      "id": 2,
      "description": "Quai Henri Pourchasse, Ivry-sur-Seine",
      "location": [
        2.4087524414062504,
        48.813194201165274
      ]
    },
    {
      "id": 3,
      "description": "51, Allée Jules Guesde, Les Pavillons-sous-Bois",
      "location": [
        2.497329711914063,
        48.89948375541988
      ]
    },
    {
      "id": 4,
      "description": "Rue La Boétie, Paris",
      "location": [
        2.309188842773438,
        48.87239311228893
      ]
    }
  ],
  "shipments": [],
  "vehicles": [
    {
      "id": 1,
      "start": [
        2.2384643554687504,
        48.93242424920101
      ],
      "startDescription": "Quai de Bezons, Argenteuil",
      "end": [
        2.2384643554687504,
        48.93242424920101
      ],
      "endDescription": "Quai de Bezons, Argenteuil"
    }
  ],
  "options": {
    "g": true
  }
}

I saw that we can input the time matrix, for example, returned by OSRM's table API.
My doubts start now, how to create a vehicle with its lat/long
What is the correct way to request the time matrix for OSRM?
What is the source and destination in the OSRM request?

@jonathf
Copy link
Collaborator

jonathf commented Jun 30, 2023

If you are going to use it as an API, the best I can offer in this second is doing something like:

instance = vroom.Input()
instance._from_json(json_string, geometry)

This is a direct call to the vroom json parser.

I'll update the Input.from_json soon to allow for string input in addition to filepath.

@bencz
Copy link
Author

bencz commented Jun 30, 2023

Well, that's a good start!
And how is the osrm configuration?

@jonathf
Copy link
Collaborator

jonathf commented Jul 3, 2023

I haven't tried it, but the format is:

instance = vroom.Input(servers={"<profile>": "<host>:<port>"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants