ISOChrone
Isochrone
With Isochrone, you can generate polygons representing the area to be reached from a given point based on distance or electricity consumption. The polygon will encompass all destinations that can be reached within a maximum travel distance or the available charging level of the electric vehicle.
Note: This feature only support offboard mode.
Isochrone based on electric consumption
Before using this feature, you should set vehicle information, for details please refer to Set electric information.
Create a route request
| auto request = direction_Service->createEvIsochroneRequestBuilder()
->setOrigin(tn::direction::models::v2::GeoLocation(37.386300,-122.005090))
.build();
|
Calculate an EV Isochrone
| tn::shared_ptr<tn::direction::api::IsochroneResponse> isochrone_response;
tn::foundation::ErrorCode error_code;
auto request = direction_Service->createEvIsochroneTask(request)
->runSync([&](tn::foundation::ErrorCode c, tn::shared_ptr<tn::direction::api::IsochroneResponse> r) {
isochrone_response = r;
error_code = c;
});
|
Isochrone based on distance
Create a route request
| auto request = direction_Service->createIsochroneRequestBuilder()
->setOrigin(tn::direction::models::v2::GeoLocation(37.386300,-122.005090))
.setMaxDistance(10000)
.setRoutePreference(
tn::direction::models::v2::RoutePreference().avoidHighway(true).avoidTollRoad(true))
.build();
|
Calculate an Isochrone
| tn::shared_ptr<tn::direction::api::IsochroneResponse> isochrone_response;
tn::foundation::ErrorCode error_code;
auto request = direction_Service->createIsochroneTask(request, tn::direction::api::CalculationMode::Offboard)
->runSync([&](tn::foundation::ErrorCode c, tn::shared_ptr<tn::direction::api::IsochroneResponse> r) {
isochrone_response = r;
error_code = c;
});
|