Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::Route Class Reference

Route object. More...

Inheritance diagram for gem::Route:
Collaboration diagram for gem::Route:

Public Member Functions

 Route (const Route &route)=default
 Default copy constructor.
 Route (Route &&route)=default
 Default move constructor noexcept is deduced.
Route & operator= (const Route &route)=default
 Default copy assignment.
Route & operator= (Route &&route)=default
 Default move assignment noexcept is deduced.
bool operator== (const Route &route) const
 Comparison operator equal.
bool operator!= (const Route &route) const
 Comparison operator not equal.
bool isPTRoute () const noexcept
 Check if the route is a Public Transit route.
const PTRouteRef toPTRoute () const noexcept
 Convert to a PTRoute from this one.
bool isEVRoute () const noexcept
 Check if the route is an EV route.
bool isOTRoute () const noexcept
 Check if the route is an over track route.
const EVRouteRef toEVRoute () const noexcept
 Convert to a EVRoute from this one.
const OTRouteRef toOTRoute () const noexcept
 Convert to an over track route from this one.
LandmarkList getWaypoints (GetWaypointsOptions options=GW_RemainingInitial) const noexcept
 Get list of route waypoints.
LandmarkList getWaypointsVia (const Landmark &viaWpt) const noexcept
 Get a new waypoints configuration using existing waypoints and the given intermediate via waypoint.
TimeDistance getTimeDistance () const noexcept
 Get length in meters and estimated travel time in seconds for the route / route segment.
TimeDistance getTimeDistance (bool activePart) const noexcept
 Get length in meters and estimated travel time in seconds for the route.
RectangleGeographicArea getGeographicArea () const noexcept
 Get geographic area of the route.
TilesCollectionGeographicArea getTilesGeographicArea () const noexcept
 Get tiles collection area of the route.
PolygonGeographicArea getPolygonGeographicArea () const noexcept
 Get Polygon Geographic Area.
bool getIncursCosts () const noexcept
 Method to check if traveling the route or route segment incurs cost to the user.
String getSummary () const noexcept
 Get the summary of the route.
void setRouteListener (RouteListener routeListener) noexcept
 Set listener for events related to the current route.
RouteListener getRouteListener () const noexcept
 Get route related events listener.
RouteTrafficEventList getTrafficEvents () const noexcept
 Get list of traffic events affecting the route.
DataBuffer exportTrafficAs (int format) const noexcept
 Export route traffic in the requested data format.
RouteSegmentList getSegments () const noexcept
 Get route segments.
int getClosestSegment (Coordinates const &coord) const noexcept
 Get index of the closest route segment to the given coordinates.
bool hasFerryConnections () const noexcept
 Check if the route contains ferry connections.
bool hasTollRoads () const noexcept
 Check if the route contains toll roads.
ERouteStatus getStatus () const noexcept
 Get route status.
DataBuffer exportAs (int format) const noexcept
 Export route data in the requested data format.
const RouteTerrainProfileRef getTerrainProfile () const noexcept
 Get route terrain profile.
Coordinates getCoordinateOnRoute (int distance) const noexcept
 Get a coordinate on route at the given distance from the departure / starting point.
TimeDistanceCoordinate getTimeDistanceCoordinateOnRoute (const Coordinates &coords) const noexcept
 Get a time-distance coordinate on route closest to the given reference coordinate.
int getDistanceOnRoute (const Coordinates &coords, bool activePart) const noexcept
 Get route distance from departure at the given coordinate.
Path getPath (int start, int end) const noexcept
 Build path from route start - end segment.
Path getPath () const noexcept
 Build path from route.
TimeDistanceCoordinateList getTimeDistanceCoordinates (int start, int end, int step, bool stepType) const noexcept
 Build a list of time-distance coordinates from a route.
const StringListRef getDominantRoads () const noexcept
 Get dominant road names.
TollSectionList getTollSections () const noexcept
 Get segment toll sections.
const RoutePreferencesRef preferences () const noexcept
 Get the route preferences.
DataBuffer dump () const noexcept
 Debug purposes.
SearchableParameterList getExtraInfo () const noexcept
 Get user extra info.
int setExtraInfo (const ParameterList &info) noexcept
 Set user extra info.
LargeInteger getId () const noexcept
 Get route unique id.

Detailed Description

Route object.

Implements share-read / copy-on-write Api object over RouteBase.

Constructor & Destructor Documentation

◆ Route() [1/2]

gem::Route::Route ( const Route & route)
default

Default copy constructor.

Parameters
[in]routeThe Route object to be copied.

◆ Route() [2/2]

gem::Route::Route ( Route && route)
default

Default move constructor noexcept is deduced.

Parameters
[in]routeThe Route object to be moved.

Member Function Documentation

◆ dump()

DataBuffer gem::RouteBase::dump ( ) const
inlinenoexceptinherited

Debug purposes.

Dump the route

Returns
A DataBuffer representation of the route's internal state.

◆ exportAs()

DataBuffer gem::RouteBase::exportAs ( int format) const
inlinenoexceptinherited

Export route data in the requested data format.

Parameters
[in]formatData format, see EPathFileFormat
Returns
Route data buffer

◆ exportTrafficAs()

DataBuffer gem::RouteBase::exportTrafficAs ( int format) const
inlinenoexceptinherited

Export route traffic in the requested data format.

Parameters
[in]formatData format, see EPathFileFormat
Returns
Route data buffer

◆ getClosestSegment()

int gem::RouteBase::getClosestSegment ( Coordinates const & coord) const
inlinenoexceptinherited

Get index of the closest route segment to the given coordinates.

Parameters
coordThe geographic coordinates to check against the route segments.
Returns
-1 if route is invalid

◆ getCoordinateOnRoute()

Coordinates gem::RouteBase::getCoordinateOnRoute ( int distance) const
inlinenoexceptinherited

Get a coordinate on route at the given distance from the departure / starting point.

Parameters
distanceThe distance from the route start, in meters.
Returns
Coordinates at the specified distance along the route.

◆ getDistanceOnRoute()

int gem::RouteBase::getDistanceOnRoute ( const Coordinates & coords,
bool activePart ) const
inlinenoexceptinherited

Get route distance from departure at the given coordinate.

Parameters
coordsThe geographic coordinates where the distance is to be measured.
activePartBoolean indicating whether to consider only the active part of the route (true) or the entire route (false).
Returns
The distance in meters from the route start to the specified coordinates.

◆ getDominantRoads()

const StringListRef gem::RouteBase::getDominantRoads ( ) const
inlinenoexceptinherited

Get dominant road names.

A road is considered dominant when it covers n% from route total length

Returns
The names list. If a road has multiple names, they will be presented as "name1 / name2 / ... / namex"

◆ getExtraInfo()

SearchableParameterList gem::RouteBase::getExtraInfo ( ) const
inlinenoexceptinherited

Get user extra info.

Returns
A string containing extra descriptive information added by user.

◆ getGeographicArea()

RectangleGeographicArea gem::RouteBase::getGeographicArea ( ) const
inlinenoexceptinherited

Get geographic area of the route.

The geographic area is the smallest rectangle that can be drawn around the route.

Returns
Geographic area covered by the route, represented as a GeographicArea object.

◆ getId()

LargeInteger gem::RouteBase::getId ( ) const
inlinenoexceptinherited

Get route unique id.

Returns
The route unique id, 0 if the route is not valid

◆ getIncursCosts()

bool gem::RouteBase::getIncursCosts ( ) const
inlinenoexceptinherited

Method to check if traveling the route or route segment incurs cost to the user.

Returns
Boolean indicating whether the route incurs additional costs (e.g., tolls).

◆ getPath() [1/2]

Path gem::RouteBase::getPath ( ) const
inlinenoexceptinherited

Build path from route.

Returns
The result path object

◆ getPath() [2/2]

Path gem::RouteBase::getPath ( int start,
int end ) const
inlinenoexceptinherited

Build path from route start - end segment.

Parameters
[in]startStart distance from route start
[in]endEnd distance from route start
Returns
The result path object

◆ getPolygonGeographicArea()

PolygonGeographicArea gem::RouteBase::getPolygonGeographicArea ( ) const
inlinenoexceptinherited

Get Polygon Geographic Area.

Returns
Geographic area of the route represented as a polygon.

◆ getRouteListener()

RouteListener gem::RouteBase::getRouteListener ( ) const
inlinenoexceptinherited

Get route related events listener.

Returns
A listener for route events.

◆ getSegments()

RouteSegmentList gem::RouteBase::getSegments ( ) const
inlinenoexceptinherited

Get route segments.

Returns
Segments of the route, each detailed with specific route information.

◆ getStatus()

ERouteStatus gem::RouteBase::getStatus ( ) const
inlinenoexceptinherited

Get route status.

Returns
Current status of the route.

◆ getSummary()

String gem::RouteBase::getSummary ( ) const
inlinenoexceptinherited

Get the summary of the route.

Returns
A summary of the route, including key metrics and descriptions.

◆ getTerrainProfile()

const RouteTerrainProfileRef gem::RouteBase::getTerrainProfile ( ) const
inlinenoexceptinherited

Get route terrain profile.

Returns
Terrain profile of the route, detailing elevation changes.

◆ getTilesGeographicArea()

TilesCollectionGeographicArea gem::RouteBase::getTilesGeographicArea ( ) const
inlinenoexceptinherited

Get tiles collection area of the route.

Returns
Detailed geographic area of the route represented in tiles.

◆ getTimeDistance() [1/2]

TimeDistance gem::RouteBase::getTimeDistance ( ) const
inlinenoexceptinherited

Get length in meters and estimated travel time in seconds for the route / route segment.

Returns
Time and distance information for the route, encapsulated in a TimeDistance object.

◆ getTimeDistance() [2/2]

TimeDistance gem::RouteBase::getTimeDistance ( bool activePart) const
inlinenoexceptinherited

Get length in meters and estimated travel time in seconds for the route.

Parameters
[in]activePartIf true and the route is part of a navigation session, returns only the active part of the route metrics

[in] If false or the route is not part of a navigation session, returns whole route metrics

Returns
The time and distance information.

◆ getTimeDistanceCoordinateOnRoute()

TimeDistanceCoordinate gem::RouteBase::getTimeDistanceCoordinateOnRoute ( const Coordinates & coords) const
inlinenoexceptinherited

Get a time-distance coordinate on route closest to the given reference coordinate.

Parameters
coordsThe reference coordinates
Returns
Time-distance coordinate on route closest to the reference coordinate

◆ getTimeDistanceCoordinates()

TimeDistanceCoordinateList gem::RouteBase::getTimeDistanceCoordinates ( int start,
int end,
int step,
bool stepType ) const
inlinenoexceptinherited

Build a list of time-distance coordinates from a route.

Parameters
[in]startStart distance from route start
[in]endEnd distance from route start
[in]stepThe step on which the coordinates are created
[in]stepTypeThe step unit type: true = distance in meters, false = time in seconds
Returns
The result list

◆ getTollSections()

TollSectionList gem::RouteBase::getTollSections ( ) const
inlinenoexceptinherited

Get segment toll sections.

Returns
The error code. On success, the toll sections are returned

◆ getTrafficEvents()

RouteTrafficEventList gem::RouteBase::getTrafficEvents ( ) const
inlinenoexceptinherited

Get list of traffic events affecting the route.

Returns
List of traffic events affecting the route.

◆ getWaypoints()

LandmarkList gem::RouteBase::getWaypoints ( GetWaypointsOptions options = GW_RemainingInitial) const
inlinenoexceptinherited

Get list of route waypoints.

The waypoints are ordered like: departure, first waypoint, ..., destination.

Parameters
[in]optionsSee GetWaypointsOptions for details
Returns
a landmark list

◆ getWaypointsVia()

LandmarkList gem::RouteBase::getWaypointsVia ( const Landmark & viaWpt) const
inlinenoexceptinherited

Get a new waypoints configuration using existing waypoints and the given intermediate via waypoint.

Parameters
[in]viaWptThe via waypoint to be inserted in the route waypoints.
Returns
A new route waypoints configuration including the given via waypoint

If route is not target to a simulation / navigation, the returned list is the initial waypoints with the via inserted in a proper index position for an optimal routing

If route is target to a simulation / navigation, the returned list is the remaining to travel waypoints with the via inserted in a proper index position for an optimal routing

◆ hasFerryConnections()

bool gem::RouteBase::hasFerryConnections ( ) const
inlinenoexceptinherited

Check if the route contains ferry connections.

Returns
Boolean indicating whether the route includes ferry connections.

◆ hasTollRoads()

bool gem::RouteBase::hasTollRoads ( ) const
inlinenoexceptinherited

Check if the route contains toll roads.

Returns
Boolean indicating whether the route includes toll roads.

◆ isEVRoute()

bool gem::Route::isEVRoute ( ) const
inlinenoexcept

Check if the route is an EV route.

Returns
True if it is an EV route, false otherwise.

◆ isOTRoute()

bool gem::Route::isOTRoute ( ) const
inlinenoexcept

Check if the route is an over track route.

Returns
True if it is an over track route, false otherwise.

◆ isPTRoute()

bool gem::Route::isPTRoute ( ) const
inlinenoexcept

Check if the route is a Public Transit route.

Returns
True if it is a Public Transit route, false otherwise.

◆ operator!=()

bool gem::Route::operator!= ( const Route & route) const
inline

Comparison operator not equal.

Parameters
[in]routeThe Route object to be compared.
Returns
True if the two objects are not equal, false otherwise.

◆ operator=() [1/2]

Route & gem::Route::operator= ( const Route & route)
default

Default copy assignment.

Parameters
[in]routeThe Route object to be copied.
Returns
The Route object.

◆ operator=() [2/2]

Route & gem::Route::operator= ( Route && route)
default

Default move assignment noexcept is deduced.

Parameters
[in]routeThe Route object to be moved.
Returns
The Route object.

◆ operator==()

bool gem::Route::operator== ( const Route & route) const
inline

Comparison operator equal.

Parameters
[in]routeThe Route object to be compared.
Returns
True if the two objects are equal, false otherwise.

◆ preferences()

const RoutePreferencesRef gem::RouteBase::preferences ( ) const
inlinenoexceptinherited

Get the route preferences.

Returns
A reference to the Preferences object managing user preferences for route calculations.

◆ setExtraInfo()

int gem::RouteBase::setExtraInfo ( const ParameterList & info)
inlinenoexceptinherited

Set user extra info.

Parameters
infoA ParameterList containing extra information to be associated with the route.
Returns
0 if the extra information was successfully set.

◆ setRouteListener()

void gem::RouteBase::setRouteListener ( RouteListener routeListener)
inlinenoexceptinherited

Set listener for events related to the current route.

Parameters
routeListenerRoute listener for this route. Use 'empty' to unregister current listener.

◆ toEVRoute()

const EVRouteRef gem::Route::toEVRoute ( ) const
inlinenoexcept

Convert to a EVRoute from this one.

Returns
The EVRoute object.

◆ toOTRoute()

const OTRouteRef gem::Route::toOTRoute ( ) const
inlinenoexcept

Convert to an over track route from this one.

Returns
The OTRoute object.

◆ toPTRoute()

const PTRouteRef gem::Route::toPTRoute ( ) const
inlinenoexcept

Convert to a PTRoute from this one.

Returns
The PTRoute object.