Skip to content
Last updated

πŸš— Routing API

The BeMap Routing API lets you compute vehicle routes, optimize trips with multiple stops, generate isochrones (travel-time zones), and calculate matrices between locations.


πŸ“Œ Use Cases

  • Standard route A to B
  • Optimized delivery trip with 5 stops
  • Show reachable areas in 15min (isochrone)
  • Avoid toll roads with truck restrictions
  • Estimate toll cost and distance for a bus

πŸ”§ Endpoint

POST /bgis/service/routing/1.0

Environments:

  • https://bemap-beta.benomad.com
  • https://bemap-preprod.benomad.com
  • https://bemap-prod.benomad.com

πŸ“₯ Example: Passenger Car Route from Paris to Brussels

{
  "geoserver": "here",
  "routingMode": "MODE_VIAS",
  "outputLanguage": "fr",
  "destinations": [
    {
      "coordinateSat": {
        "lon": 2.32158,
        "lat": 48.86533
      }
    },
    {
      "coordinateSat": {
        "lon": 4.35655,
        "lat": 50.8447
      }
    }
  ],
  "options": [
    "POLYLINE"
  ],
  "routingVehicleProfile": {
    "transportMode": "CAR"
  }
}

πŸ“₯ Example: Truck Avoiding Toll Roads from Brussels to Paris

{
  "routingMode": "MODE_VIAS",
  "outputLanguage": "fr",
  "destinations": [
    {
      "coordinateSat": {
        "lon": 4.35655,
        "lat": 50.8447
      }
    },
    {
      "coordinateSat": {
        "lon": 2.32158,
        "lat": 48.86533
      }
    }
  ],
  "options": [
    "POLYLINE"
  ],
  "routingCriterias": [
    "AVOID_TOLLS"
  ],
  "routingVehicleProfile": {
    "transportMode": "TRUCK"
  }
}

🧠 Routing Modes

The routingMode field defines how the route will be calculated, depending on how many origin and destination points you provide, and the type of result you expect.
Default: MODE_VIAS.

"routingMode": "MODE_VIAS"
ModeDescription
MODE_VIASStandard A ➝ B ➝ C route.
Use this for a basic route with optional waypoints.
πŸ“Œ Example: From Lyon ➝ Vienne ➝ Valence
MODE_1_TO_NOne origin to many destinations.
Computes individual routes from a single point to a list of target points.
πŸ“Œ Example: From Lyon ➝ Marseille, Lyon ➝ Nice, Lyon ➝ Paris
MODE_N_TO_1Many origins to one destination.
Computes individual routes from multiple points to a single endpoint.
πŸ“Œ Example: From Annecy ➝ Lyon, Grenoble ➝ Lyon, Dijon ➝ Lyon
MODE_N_TO_NFull NxN matrix.
Calculates all possible routes between each pair of points in a list.
πŸ“Œ Example: A full delivery coverage from every warehouse to every client
MODE_MATRIXDistance/time matrix.
Returns a matrix of durations (in seconds), distances (in meters), or energy consumption (in Wh) between origin(s) and destination(s).
πŸ“Œ Example: How long does it take from each depot to each delivery point?
MODE_ISOCHRONEReachable zone polygon.
Returns an area that can be reached within a given time, distance or energy.
πŸ”Ή With 1 point: Reachable area starting from Lyon in 30 min.
πŸ”Ή With 2 points: Reachable area starting from Lyon and ending in Valence, within a time or energy limit. Useful for EV planning.

πŸ‘‰ For detailed examples and usage, check out the tutorial.


βš™οΈ Routing Criterias

Comma-separated list (e.g. "AVOID_TOLLS,FASTEST"):

  • FASTEST (default): Find the route which optimizes travel time.
  • SHORTEST: Find the route which optimizes travel distance.
  • AVOID_TOLLS: Finds a route which avoids tolls.
  • AVOID_FERRIES: Finds a route which avoids ferries.
  • AVOID_MOTORWAYS: Finds a route which avoids motorways.
  • AVOID_UNPAVED: Finds a route which avoids unpaved roads.
  • AVOID_CROSSING_BORDER: Finds a route which avoids country border crossings (only when all coordinates are in a same country)
  • CARPOOL: Finds a route which avoids roads reserved to carpooling.
  • ECO_ENERGY: Find the route which optimizes travel energy consumption.
  "routingCriterias": [
    "FASTEST",
    "SHORTEST",
    "AVOID_FERRIES",
    "AVOID_MOTORWAYS",
    "AVOID_TOLLS",
    "AVOID_UNPAVED",
    "AVOID_CROSSING_BORDER",
    "CARPOOL",
    "ECO_ENERGY"
  ],

πŸ‘‰ For detailed examples and usage, check out the tutorial


πŸš› Vehicle Profile (routingVehicleProfile)

"routingVehicleProfile": {
  "transportMode": "CAR",
  "routingVehicleFeature": {
    "maxSpeed": 90,
    "vehicleWeight": 1500,
    "emissionClass": "EURO6"
  }
}
FieldDescription
transportModeDefines the transportation mode (e.g., CAR, TRUCK, PEDESTRIAN).
Default is CAR, except for Traceroute where it’s EMERGENCY.
This affects routing due to map data constraints like turn restrictions, traffic directions, and accessibility.

Available values:
- BICYCLE: Bicycle
- CAR: Passenger car
- EMERGENCY: Emergency vehicle
- MOTORCYCLE: Motorcycle
- PEDESTRIAN: Pedestrian
- PUBLIC_BUS: Public bus
- TAXI: Taxi
- TRUCK: Truck
routingVehicleFeatureDefines physical, legal and toll characteristics of the vehicle. Affects routing and toll calculation.
routingEnergyVehicleFeatureFor EV routing (optional)
maxSpeedsThis field lets you tell the routing engine how fast your vehicle is allowed to go (in km/h).
You can set:
- One speed for route calculation (CAL)
- Another for arrival time estimation (ETA)
- Or one value for both (ALL)
routingSpeedPonderationsAdjust road speed classes

πŸ‘‰ For detailed examples and usage, check out the tutorial


πŸ”„ Optimization Options (routingMode)

"options": [ "OPTIMIZED_TRIP", "OPTIMIZED_TRIP_CLOSE" ]

πŸ‘‰ For detailed examples and usage, check out the tutorial


⚑ Energy Vehicle (routingEnergyVehicleFeature)

FieldTypeDescription
auxConsumptionintInstantaneous consumption of auxiliary equipment (in W)
batCapacitydoubleBattery capacity (in kWh)
crrdoubleRolling resistance coefficient (T/T)
dryWeightintVehicle’s dry weight (in kg)
energyLoaddoubleInitial battery charge (in kWh)
engineEfficiencydoubleEngine-to-wheel efficiency ratio (dimensionless)
extTempfloatExternal temperature (in Β°C)
maxAcceldoubleMaximum acceleration (in m/sΒ²)
maxChargePowerdoubleMax AC single-phase charge power (in kW)
maxChargePowerAc3doubleMax AC three-phase charge power (in kW)
maxChargePowerDcdoubleMax DC charge power (in kW)
maxDeceldoubleMaximum deceleration (in m/sΒ²)
payloadintAdditional load weight (in kg)
regenerativeBrakingbooleanWhether vehicle uses regenerative braking
scxdoubleSCx = frontal area drag coefficient (in mΒ²)

πŸ‘‰ For detailed examples and usage, check out the tutorial


Routing Speed Coefficient (routingSpeedPond)

FieldOptionalTypeDescription
factor❌floatSpeed coefficient. A value under 1 reduces speed (e.g. 0.8), over 1 increases speed (e.g. 1.3). Default: 1.
level❌intRoad level: 0 (all), 1 (main), 2 (secondary), 3 (tertiary), 4 (fourth).
pondTypeβœ…stringPonderation type. One of: ALL (default), CAL, ETA.
roadTypeβœ…stringRoad type. One of: ALL, DEFAULT, FERRY, MOTORWAY, PEDESTRIAN, ROUNDABOUNT, SLIPROAD.

πŸ‘‰ For detailed examples and usage, check out the tutorial


🚐 Vehicle Feature Fields (routingVehicleFeature)

FieldOptionalDescription
weightβœ…Total weight in tens of metric tons. Affects route calculation. Type: int.
widthβœ…Width of vehicle in centimeters. Affects route calculation. Type: int.
heightβœ…Height of vehicle in centimeters. Affects route calculation. Physical restriction. Type: int.
lengthβœ…Length of vehicle in centimeters. Affects route calculation. Physical restriction. Type: int.
onlyPhysicalβœ…Defines if physical constraints are ignored outside bridges and tunnels. false by default. Affects route calculation. Type: boolean.
nbTrailerβœ…Vehicle's number of trailers (-1: not defined, 0: no trailer). Affects route calculation. Legal restriction. Type: int.
adrTunnelCategoryβœ…ADR tunnel category defines all supported ADR (EU only, European Agreement concerning the International Carriage of Dangerous Goods by Road). Affects route calculation.

Available values:
- CAT_B
- CAT_C
- CAT_D
- CAT_E
- NONE
axleWeightβœ…Axle weight in tens of metric tons, i.e.: 12 = 1.2t. Affects route calculation. Legal and physical restrictions. Type: int.
hazardousMaterialsβœ…Hazardous materials carried by the vehicle. Affects route calculation. Legal restriction.

Available values:
- ALL
- EXPLOSIVE
- NONE
- TUNNEL_CAT_B
- TUNNEL_CAT_B1000C
- TUNNEL_CAT_BD
- TUNNEL_CAT_BE
- TUNNEL_CAT_C
- TUNNEL_CAT_C5000D
- TUNNEL_CAT_CD
- TUNNEL_CAT_CE
- TUNNEL_CAT_D
- TUNNEL_CAT_DE
- TUNNEL_CAT_E
- US_CORROSIVE
- US_EXPLOSIVES
- US_FLAM
- US_FLAM_SOL
- US_GAS
- US_ORGANIC
- US_OTHER
- US_PIH
- US_POISON
- US_RADIO_ACTIVE
- WATER
caravanβœ…Defines if the vehicle has a caravan. Affects toll calculation. UNDEFINED by default.

Available values:
- NO
- UNDEFINED
- YES
cialβœ…Defines if vehicle is a commercial vehicle. Affects toll calculation. UNDEFINED by default.

Available values:
- NO
- UNDEFINED
- YES
disEquippedβœ…Defines if vehicle is equipped for disabled people. Affects toll calculation. UNDEFINED by default.

Available values:
- NO
- UNDEFINED
- YES
emissionClassβœ…Defines vehicle's emission type (optional). Affects toll calculation.

Available values:
- ELECTRIC
- EURO0
- EURO1
- EURO2
- EURO2_PRC
- EURO3
- EURO3_PRC
- EURO4
- EURO5
- EURO6
- EURO6_CO2_1
- EURO6_CO2_2
- EURO6_CO2_3
- EURO6_CO2_4
- EURO6_CO2_5
- EURO_EEV
- MAX
- UNDEFINED
hovβœ…Defines if vehicle is a High Occupancy Vehicle (USA only). Affects toll calculation. UNDEFINED by default.

Available values:
- NO
- UNDEFINED
- YES
hybridβœ…Defines if vehicle has a hybrid engine. Affects toll calculation. UNDEFINED by default.

Available values:
- NO
- UNDEFINED
- YES
nbPassengersβœ…Defines the number of passengers (optional). Affects toll calculation. Type: int.
nbTiresβœ…Defines the number of tires (optional). Affects toll calculation. Type: int.
nbTrailAxlesβœ…Defines the number of axles of the trailer (optional). Affects toll calculation. Type: int.
nbVehAxlesβœ…Defines the number of axles of the vehicle (optional). Affects toll calculation. Type: int.
pollMinβœ…Defines if vehicle has minimal pollution. Affects toll calculation. UNDEFINED by default.

Available values: NO, UNDEFINED, YES
tollTransportCategoryβœ…Defines the toll vehicle category. Affects toll calculation. UNDEFINED by default.

Available values:
- AUTO
- BUS
- DLV_TRUCK
- MINIBUS
- MOTOR_HOME
- MOTORCYCLE
- PICK_UP
- SIDECAR
- SNOWMOBILE
- TRACTOR
- TRICYCLE
- TRUCK
- UNDEFINED
trailHeightβœ…Trailer's height in centimeters. Affects toll calculation. Type: int.
vehHeightβœ…Vehicle's height in centimeters. Affects toll calculation. Type: int.
vehWeightβœ…Vehicle's weight in tens of tons. Affects toll calculation. Type: int.

πŸ‘‰ For detailed examples and usage, check out the tutorial


πŸ“‘ EVENT Options – Route Segment Events

The EVENT option enriches the routing response by including detailed per-segment information about the computed path. This is particularly useful for applications needing granular insight into road conditions, elevation, traffic, costs, and more.

Activating EVENT adds an array of event entries to the response. Each entry corresponds to a segment of the route and can include various attributes depending on the sub-options (EVT_XXXX) selected.

πŸ“‹ List of EVENT Sub-options

The EVENT option enriches the routing response with detailed road segment information. Below are its sub-options:

"options": [ "EVENT", "EVT_ELEVATION2", "EVT_TRAFFIC" ]
OptionDescription
EVENTEnables structure of events along the route. Returns segments with metadata such as distance, time, and country code.
EVT_DUPLICATE_FILTERFilters repeated values to avoid duplication across unchanged segments.
EVT_DURATIONAdds estimated travel duration of each segment (in seconds).
EVT_ELEVATION2Returns elevation data in one entry: altitude at the beginning and end of the segment.
EVT_ENCODED_POLYLINEReturns polyline geometry encoded.
EVT_ENERGY_CONSUMPTIONEstimates energy usage. Requires routingEnergyVehicleFeature. Returns autonomy limit (energyEndOfAutonomyAt, energyEndOfAutonomyCoord).
EVT_ENERGY_CONSUMPTION_SAMPLEReturns sampled energy data every second (dist, speed, slope, pos, etc.). Requires routingEnergyVehicleFeature.
EVT_ENTRY_VALUE_AS_OBJECTOutputs entries as JSON objects instead of strings.
EVT_GEOELEMENT_TYPEIncludes road classification: FOURTH_ROAD, TERTIARY_ROAD, MOTORWAY, FERRY, etc.
EVT_LENGTHAdds segment length in meters.
EVT_OBJECTID_BASE64Adds a base64 Object ID related to the map release.
EVT_POLYLINEReturns unencoded polyline geometry.
EVT_PROHIBITED_DRIVINGShows prohibited driving data (e.g. wrong direction, blocked passage).
EVT_ROAD_FEATUREAdds road details: speed limit, number of lanes, tunnels, bridges, etc.
EVT_ROUTESHEETAdds turn-by-turn route sheet instructions in the event structure.
EVT_SEGMENT_INFOReturns segment ID and whether it's traversed in reverse.
EVT_TAX_COSTReturns tax cost. Requires specific vehicle profile and map data.
EVT_TOLL_COSTReturns toll cost. Requires specific vehicle profile and map data.
EVT_TRAFFICAdds real-time traffic data: jam factor, speed, etc. Does NOT affect routing.
EVT_TRAFFIC_HISTORICAL(Beta) Historical traffic based on past departure time. Does NOT affect routing.
EVT_TRAFFIC_SIGNSDisplays traffic signs info (e.g. STOP, YIELD, pedestrian crossing).
EVT_WAYPOINTSAdds route waypoints with coordinates and metadata.

πŸ‘‰ For detailed examples and usage, check out the tutorial


🧭 Tips for Non-Developers

  • You can use Postman to test routes visually.
  • The more fields you provide, the more precise the results.
  • Start simple (origin/destination + mode) and add filters.

πŸ”— API Playground

You can test this API endpoint directly in our dedicated BeMap documentation environment.

πŸ‘‰ Go to BeMap API Playground