CartoType C++ API 9.2-11-g041bcfff8
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Friends | List of all members
CartoTypeCore::Route Class Reference

#include <cartotype_navigation.h>

Public Member Functions

 Route (InputStream &aInput, std::shared_ptr< CartoTypeCore::Projection > aProjection)
 
 Route (const CartoTypeCore::RouteProfile &aProfile, std::shared_ptr< CartoTypeCore::Projection > aProjection)
 
std::unique_ptr< CartoTypeCore::GeometryGeometry () const
 
std::unique_ptr< CartoTypeCore::GeometryGeometryInDegrees (Result &aError) const
 
bool Empty () const
 
size_t RouteSegmentCount () const
 
std::shared_ptr< CartoTypeCore::RouteSegmentRouteSegment (size_t aIndex) const
 
double Distance () const
 
double Time () const
 
const OnCurveContourPath () const
 
const PathToJunctionPathToJunctionBefore () const
 
const PathToJunctionPathToJunctionAfter () const
 
const CartoTypeCore::RouteProfileRouteProfile () const
 
std::shared_ptr< CartoTypeCore::Projection > Projection () const
 
Result WriteAsXml (OutputStream &aOutput) const
 
Result WriteAsGpx (OutputStream &aOutput) const
 
NearestSegmentInfo NearestSegment (const Point &aPoint, int32_t aSection, double aPreviousDistanceAlongRoute) const
 
NearestSegmentInfo PointAtDistance (double aDistanceInMeters) const
 
NearestSegmentInfo PointAtTime (double aTimeInSeconds) const
 
std::unique_ptr< RouteCopyWithoutRestrictedSegments () const
 
String Instructions (CMap &aMap, const char *aLocale, bool aMetricUnits, bool aAbbreviate) const
 
double TollRoadDistance () const
 
std::vector< PointRoutePoints () const
 

Friends

class RouteBuilder
 
class RouteHandler
 

Detailed Description

A route. This class is immutable and so is most easily used via shared pointers.

Constructor & Destructor Documentation

◆ Route() [1/2]

CartoTypeCore::Route::Route ( InputStream aInput,
std::shared_ptr< CartoTypeCore::Projection >  aProjection 
)

Creates a route by reading an XML CartoTypeRoute element. Uses aProjection to project the points from longitude (x) and latitude (y).

◆ Route() [2/2]

CartoTypeCore::Route::Route ( const CartoTypeCore::RouteProfile aProfile,
std::shared_ptr< CartoTypeCore::Projection >  aProjection 
)

Creates an empty route with a given route profile.

Member Function Documentation

◆ CopyWithoutRestrictedSegments()

std::unique_ptr< Route > CartoTypeCore::Route::CopyWithoutRestrictedSegments ( ) const

Copies a route but does not copy restricted segments (e.g., private roads).

◆ Distance()

double CartoTypeCore::Route::Distance ( ) const
inline

The distance along the route in meters.

◆ Empty()

bool CartoTypeCore::Route::Empty ( ) const
inline

Returns true if this route has no route segments.

◆ Geometry()

std::unique_ptr< CartoTypeCore::Geometry > CartoTypeCore::Route::Geometry ( ) const

Creates a Geometry object containing the points of a route in map coordinates.

◆ GeometryInDegrees()

std::unique_ptr< CartoTypeCore::Geometry > CartoTypeCore::Route::GeometryInDegrees ( Result aError) const

Creates a Geometry object containing the points of a route in degrees.

◆ Instructions()

String CartoTypeCore::Route::Instructions ( CMap &  aMap,
const char *  aLocale,
bool  aMetricUnits,
bool  aAbbreviate 
) const

Returns textual instructions for a route. For internal use only.

◆ NearestSegment()

NearestSegmentInfo CartoTypeCore::Route::NearestSegment ( const Point aPoint,
int32_t  aSection,
double  aPreviousDistanceAlongRoute 
) const

Gets information about the nearest route segment to a point given in map coordinates.

The parameter aSection gives the current route section (a part of the route between waypoints; simple routes have a single section). The returned segment will always be in the current section or a following section. It is theoretically possible for a section to be completely skipped if it is very short or of zero length, so there is no constraint that section 0 must be followed by section 1 and not by section 2, etc. If aSection is negative it is ignored and the returned segment may be in any section.

The parameter aPreviousDistanceAlongRoute should be provided (set to a value greater than zero) for multi-section routes, so that the correct route segment can be chosen if the route doubles back on itself. Positions further along the route will be given preference over those earlier in the route.

◆ Path()

const OnCurveContour & CartoTypeCore::Route::Path ( ) const
inline

The path along the entire route in map units.

◆ PathToJunctionAfter()

const PathToJunction & CartoTypeCore::Route::PathToJunctionAfter ( ) const
inline

The path to the first non-trivial junction after the route: used when creating OpenLR location data.

◆ PathToJunctionBefore()

const PathToJunction & CartoTypeCore::Route::PathToJunctionBefore ( ) const
inline

The path to the first non-trivial junction before the route: used when creating OpenLR location data.

◆ PointAtDistance()

NearestSegmentInfo CartoTypeCore::Route::PointAtDistance ( double  aDistanceInMeters) const

Gets information about the point a certain distance along a route.

◆ PointAtTime()

NearestSegmentInfo CartoTypeCore::Route::PointAtTime ( double  aTimeInSeconds) const

Gets information about the point a certain estimated time along a route.

◆ Projection()

std::shared_ptr< CartoTypeCore::Projection > CartoTypeCore::Route::Projection ( ) const
inline

The projection used to convert points from longitude (x) and latitude (y) to the map coordinates stored in this route.

◆ RoutePoints()

std::vector< Point > CartoTypeCore::Route::RoutePoints ( ) const

Returns the waypoints of the route. The number of points is one more than the number of route sections.

◆ RouteProfile()

const CartoTypeCore::RouteProfile & CartoTypeCore::Route::RouteProfile ( ) const
inline

The profile used to create the route.

◆ RouteSegment()

std::shared_ptr< CartoTypeCore::RouteSegment > CartoTypeCore::Route::RouteSegment ( size_t  aIndex) const
inline

Returns a route segment by index.

◆ RouteSegmentCount()

size_t CartoTypeCore::Route::RouteSegmentCount ( ) const
inline

Returns the number of route segments.

◆ Time()

double CartoTypeCore::Route::Time ( ) const
inline

The estimated time taken to traverse the route in seconds.

◆ TollRoadDistance()

double CartoTypeCore::Route::TollRoadDistance ( ) const

Returns the total distance in metres of the parts of the route that are on toll roads.

◆ WriteAsGpx()

Result CartoTypeCore::Route::WriteAsGpx ( OutputStream aOutput) const

Writes a route in GPX format.

◆ WriteAsXml()

Result CartoTypeCore::Route::WriteAsXml ( OutputStream aOutput) const

Writes a route as an XML CartoTypeRoute element.


The documentation for this class was generated from the following file: