Driving Range Polygon API¶
Introduction¶
Mappls Driving Range Polygon API computes areas that are reachable within specified time or distance intervals from a location, and returns the reachable regions as contours of polygons or lines that you can display on a map. This create the drive time polygons that use actual street networks based on given distance or time. This is required in order to quickly determine how much time or distance one will need to get to other locations on map and in specified time where can he reached.
What it looks like¶
In the above clip, you can see the driving range calculated from Bhuntar Airport, Kullu for a 30 mins (purple) and a 60 mins (pink) driving range.
Getting Access¶
Before using the API in the your solution, please ensure that the related access is enabled in the Mappls Console, within your app - be it for Mobile OR Web or Cloud integration.
- Copy and paste the key from your
credentials
section from your API keys into theaccess_token
query parameter.- Your static key can be secured by whitelisting its usage for particular IPs (in case of cloud app usage) OR a set of domains (in case of a web app)
- Your static key obtained from your Console is to be passed as a query parameter:
access_token
.
Authentication Object - access_token
mandatory query parameter.¶
access_token
: "hklmgbwzrxncdyavtsuojqpiefrbhqplnm".
URL¶
https://route.mappls.com/routev2/optimization/isopolygon?
Input Method¶
GET
Request Parameters¶
Mandatory Parameters¶
locations
: Location which will be center point for driving range polygon that will surrounded by roads which can be reached from this point in specified time or distance range(s). The input is supported as a latitude,longitude in decimal degrees.- For example
28.555390931473642,77.08572454324664
.
- For example
rangeType
: To specify the type of range which is used to calculate the polygon. Default value is "time". Acceptable values are:time
: to specify driving range calculation reachable within the specified time.distance
: to specify driving range calculation reachable within the specified distance from the reference position specified in thelocations
parameter.
costing
: Profile for routing engine. Currently the only applicable profile is set to automatic detection orauto
.- Example
costing=auto
.
- Example
speedTypes
: To specify the type of ETA calculations. Available values are:predictive
(default) - used to specify predictive ETA calculation. In case if this is used, then the optional parameter ofdate_time
becomes mandatory.optimal
: To specify ETA calculation acc. to current time.
contours
: An array of contour objects with either time in minutes or distance in kilometers and color to use for each isopolygon contour. One can specify up to five contours. Input is specified as a pair comprising of:time
ordistance
:time
: A floating point value specifying the time in minutes and maximun value is 120 minutes.distance
: A floating point value specifying the distance in kilometer and maximun value is 100 kilometer.
color
: The color for the output of the contour. Specify it as a Hex value, such as "color":"ff0000" for red. If no color is specified, the driving range polygon service will assign a default color to the output.
Optional Parameters¶
date_time
: This is the local date and time at the source location along with its type. The date and time is specified in ISO 8601 format (YYYY-MM-DDThh:mm) in the local time zone of departure. For example2020-07-24T12:00
. Applicable types are:0
: Current departure time.1
: Specified departure time.- Example:
date_time=1,2021-12-20T11:00
- Example:
denoise
: A floating point value from 0 to 1 (default of 1) which can be used to remove smaller contours. A value of 1 will only return the largest contour for a given time value. A value of 0.5 drops any contours that are less than half the area of the largest contour in the set of contours for that same time/distance value.polygons
: A boolean value to determine whether to return geojson polygons or linestrings as the contours. The default is false, which returns lines; when true, polygons are returned. Note: When polygons is true, any contour that forms a ring is returned as a polygon.generalize
: A floating point value in meters used as the tolerance for Douglas-Peucker generalization. Note: Generalization of contours can lead to self-intersections, as well as intersections of adjacent contours.id
: Name of the input request. Ifid
is specified, the same is returned with the response.show_locations
(boolean): A boolean indicating whether the input locations should be returned as MultiPoint features: one feature for the exact input coordinates and one feature for the coordinates of the network node it snapped to. Default false.
Please contact API Support in case you have any queries related to above request parameters.
Response Status Codes¶
Status Code | Status | Description |
---|---|---|
200 | Successful Response | A happy bit of json describing your result |
400 | Failed to parse request | You need a valid request |
400 | Failed to parse location | You need a valid location object in your json request |
400 | Failed to parse correlated location | There was a problem with the location once correlated to the routing network |
400 | No costing provided | You forgot the costing parameter |
400 | Insufficient number of locations provided | You didn't provide enough locations |
400/401 | Exceeded max route locations of X | You are asking for too many locations |
400 | Locations are in unconnected regions. | You are routing between regions of no connectivity |
400 | No costing method found for 'X' | You are asking for a non-existent costing mode |
400 | No suitable road network near location | There were no roads applicable to your mode of travel near the input location |
400 | No data found for location | There was no route data found at the input location |
400 | No path could be found for input | There was no path found between the input locations |
401 | Unauthorized | Developer’s key is not allowed to send a request |
403 | Forbidden | Developer’s key has hit its daily/hourly limit. |
405 | Try a GET request instead | We only support GET requests |
412 | Precondition Failed | Mandatory parameter is missing |
500 | Internal Server Error | The request caused an error in our systems. |
501 | Not implemented | Not Implemented |
503 | Service Unavailable | Maintenance break or server down-times |
Sample cURL Request¶
curl --location --request GET 'https://route.mappls.com/routev2/optimization/isopolygon?locations=28.632282,77.218527&costing=auto&rangeType=time&contours=1,ff0000&speedTypes=predictive&date_time=1,2021-12-12T15:00&denoise=0.5&polygons=false&generalize=1.2&id=walk from office&show_locations=true&access_token=hklmgbwzrxncdyavtsuojqpiefrbhqplnm'
Document Version History¶
Version | Last Updated | Author |
---|---|---|
1.0.0 | June 2025 | Mappls API Team (KB) |
0.0.1 | June 2022 | Mappls API Team (KB) |
API Version History¶
Version | Last Updated | Author | Revised Sections |
---|---|---|---|
0.1 | 2021-06-17 | Mappls API Team (PS) | Initial release |
For any queries and support, please contact:
Email us at apisupport@mappls.com
Support
Need support? contact us!