Routing API

Planning is used to search for a route between two (or more) points. The function finds a suitable route based on the selected planning type (by car, on foot, …) and returns the length, time, and geometry of the found route.

Function Description

  • Plan Route – The function plans a route between two (or more) points.

Technical Documentation

https://api.mapy.cz/v1/docs/routing/

The technical documentation provides an exact description of input and output parameters, default values, errors, and other details.

You can try out the function in the Testing Laboratory.

Input Parameters

start, endStarting and ending coordinates
routeTypePlanning type – more in the chapter on Planning Types
langPreferred language for the names of the searched entities.
formatOutput geometry format of the route (geojson, polyline, polyline)
avoidTollAvoid toll sections
waypointsWaypoints, up to 15. The proposed route will go from the start, through these waypoints (in the specified order), to the destination.

Return Values

lengthRoute length in meters
durationEstimated time for passage in seconds
geometryRoute geometry suitable for map rendering (in the chosen format)

Planning Types

Planning supports various types of planning, according to which it optimizes the proposed route:

  • car – fast – searches for a fast car route
  • car – fast with traffic – searches for a fast car route considering the current traffic conditions, congestion, etc. (only in the Czech Republic, without considering traffic outside the Czech Republic)
  • car – short – searches for a short car route
  • foot – fast – searches for a fast walking route
  • bicycle – road – searches for a route for road bicycles, with asphalt surface, preferring cycle paths and bike trails
  • bicycle – mountain – searches for a route for mountain bikes, preferring cycle paths and bike trails regardless of the surface