Features

Working with Map Data

A how-to guide for working with map data when running in Nextmv Cloud.

Note that Map Data is a paid feature. Contact Nextmv for more information.

This feature is configurable via options in the input, without the need for code customization and is available for both the Nextmv routing app on Marketplace and custom routing apps following the nextroute template input schema on Platform. You can find a list of all available features here.

This how-to guide assumes you already completed the get started with vehicle routing tutorial.

If you specify vehicle speeds in your input when using maps they will be ignored since a duration matrix is produced with the map durations.

Activate this feature to use real map data to calculate the distance and duration it takes to go from one location to another.

When you specify a distance and/or duration matrix in your input, you tell the solver how to calculate travel cost. The Nextmv routing maps feature generates these matrices for you when running on the Cloud prior to performing an optimization.

To have Nextmv generate map data, specify the nextmv-routing-maps option in the options section of your run input with an empty value:

{
  "options": {
    "nextmv-routing-maps": "",
  }
}
Copy

Nextmv preprocesses your request payload, generating an intermediate input file that includes the duration and distance matrices. Note this is the payload, which includes both the solver input and the runner options. The following example shows a cloud request for generating map data.

{
  "options": {
    "nextmv-routing-maps": "",
  },
  "input": {
    "defaults": {
      "vehicles": {
        "start_location": { "lon": -95.364278, "lat": 29.833861 },
        "end_location": { "lon": -95.364278, "lat": 29.833861 },
        "start_time": "2021-10-17T09:00:00-06:00",
        "capacity": 5
      }
    },
    "vehicles": [
      { "id": "vehicle-1" },
      { "id": "vehicle-2" }
    ],
    "stops": [
      { "id": "location-1", "location": { "lon": -95.35903, "lat": 29.83378 } },
      { "id": "location-2", "location": { "lon": -95.3513, "lat": 29.842255 } },
      { "id": "location-3", "location": { "lon": -95.36741, "lat": 29.845114 } },
      { "id": "location-4", "location": { "lon": -95.37284, "lat": 29.833231 } },
      { "id": "location-5", "location": { "lon": -95.369545, "lat": 29.825756 } },
      { "id": "location-6", "location": { "lon": -95.35084, "lat": 29.836535 } }
    ]
  }
}
Copy

The maps data service uses the OSRM engine with the following characteristics:

  • An OpenStreets model that covers the entire world.
  • A profile that is fixed to a car vehicle.
  • Real road data (no traffic data).

When generating the matrices the vehicle start and end locations as well as stops are considered. If you define any start or end locations, then you must have a location for every vehicle, or a default location as illustrated above. You may have start locations but omit end locations, or vice versa.

Page last updated