CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_navigation.h>
Public Member Functions | |
Route (InputStream &aInput, const Projection &aProjection) | |
Route (const RouteProfile &aProfile) | |
std::unique_ptr< CartoTypeCore::Geometry > | Geometry () const |
void | Clear (bool aClearProfile=true) |
bool | Empty () const |
Result | WriteAsXml (OutputStream &aOutput, const Projection &aProjection) const |
Result | WriteAsGpx (OutputStream &aOutput, const Projection &aProjection) const |
NearestSegmentInfo | NearestSegment (const Point &aPoint, int32_t aSection, double aPreviousDistanceAlongRoute) const |
NearestSegmentInfo | PointAtDistance (double aDistanceInMeters) const |
NearestSegmentInfo | PointAtTime (double aTimeInSeconds) const |
void | Append (const Route &aRoute) |
std::unique_ptr< Route > | Copy () const |
std::unique_ptr< Route > | CopyWithoutRestrictedSegments () const |
String | Instructions (CMap &aMap, const char *aLocale, bool aMetricUnits, bool aAbbreviate) const |
double | TollRoadDistance () const |
void | AppendSegment (const Router::TJunctionInfo &aBestArcInfo, const String &aJunctionName, const String &aJunctionRef, const Contour &aContour, const String &aName, const String &aRef, FeatureInfo aFeature, double aDistance, double aTime, int32_t aSection) |
Public Attributes | |
std::vector< std::unique_ptr< CartoTypeCore::RouteSegment > > | RouteSegment |
double | Distance = 0 |
double | Time = 0 |
OnCurveContour | Path |
PathToJunction | PathToJunctionBefore |
PathToJunction | PathToJunctionAfter |
RouteProfile | Profile |
Information about an entire route.
CartoTypeCore::Route::Route | ( | InputStream & | aInput, |
const Projection & | aProjection | ||
) |
Creates a route by reading an XML CartoTypeRoute element. Uses aProjection to project the points from latitude and longitude.
|
explicit |
Creates an empty route with a given route profile.
void CartoTypeCore::Route::Append | ( | const Route & | aRoute | ) |
Appends one route to another.
void CartoTypeCore::Route::AppendSegment | ( | const Router::TJunctionInfo & | aBestArcInfo, |
const String & | aJunctionName, | ||
const String & | aJunctionRef, | ||
const Contour & | aContour, | ||
const String & | aName, | ||
const String & | aRef, | ||
FeatureInfo | aFeature, | ||
double | aDistance, | ||
double | aTime, | ||
int32_t | aSection | ||
) |
Appends a segment to a route. For internal use only.
void CartoTypeCore::Route::Clear | ( | bool | aClearProfile = true | ) |
Sets the route to empty. Sets the route profile to a default value (clears it) if aClearProfile is true.
std::unique_ptr< Route > CartoTypeCore::Route::Copy | ( | ) | const |
Copies a route.
std::unique_ptr< Route > CartoTypeCore::Route::CopyWithoutRestrictedSegments | ( | ) | const |
Copies a route but does not copy restricted segments (e.g., private roads).
|
inline |
Returns true if this route has no route segments.
std::unique_ptr< CartoTypeCore::Geometry > CartoTypeCore::Route::Geometry | ( | ) | const |
Creates a Geometry object containing the points of a route.
String CartoTypeCore::Route::Instructions | ( | CMap & | aMap, |
const char * | aLocale, | ||
bool | aMetricUnits, | ||
bool | aAbbreviate | ||
) | const |
Returns textual instructions for a route. For internal use only.
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.
NearestSegmentInfo CartoTypeCore::Route::PointAtDistance | ( | double | aDistanceInMeters | ) | const |
Gets information about the point a certain distance along a route.
NearestSegmentInfo CartoTypeCore::Route::PointAtTime | ( | double | aTimeInSeconds | ) | const |
Gets information about the point a certain estimated time along a route.
double CartoTypeCore::Route::TollRoadDistance | ( | ) | const |
Returns the total distance in metres of the parts of the route that are on toll roads.
Result CartoTypeCore::Route::WriteAsGpx | ( | OutputStream & | aOutput, |
const Projection & | aProjection | ||
) | const |
Writes a route in GPX format.
Result CartoTypeCore::Route::WriteAsXml | ( | OutputStream & | aOutput, |
const Projection & | aProjection | ||
) | const |
Writes a route as an XML CartoTypeRoute element. Uses aProjection to inverse-project the points back to latitude and longitude.
double CartoTypeCore::Route::Distance = 0 |
The distance of the route in meters.
OnCurveContour CartoTypeCore::Route::Path |
The path along the entire route in map units.
PathToJunction CartoTypeCore::Route::PathToJunctionAfter |
The path to the first non-trivial junction after the route: used when creating OpenLR location data.
PathToJunction CartoTypeCore::Route::PathToJunctionBefore |
The path to the first non-trivial junction before the route: used when creating OpenLR location data.
RouteProfile CartoTypeCore::Route::Profile |
The profile used to create the route.
std::vector<std::unique_ptr<CartoTypeCore::RouteSegment> > CartoTypeCore::Route::RouteSegment |
An array of route segments representing the route.
double CartoTypeCore::Route::Time = 0 |
The estimated time taken to traverse the route in seconds.