9#include <cartotype_feature_info.h>
10#include "CartoTypeResult.h"
18 return (
char(A -
'a' + 1) << 10) | (char(B -
'a' + 1) << 5) | (
char(C -
'a' + 1));
384 KRouteAccessShift = 26,
385 KRouteAccessMask = int(63U << KRouteAccessShift),
386 KRouteAccessWrongWayFlag = 1 << 26,
387 KRouteAccessPedestrianFlag = 1 << 27,
388 KRouteAccessCycleFlag = 1 << 28,
389 KRouteAccessMotorVehicleFlag = 1 << 29,
390 KRouteAccessEmergencyVehicleFlag = 1 << 30,
391 KRouteAccessOtherFlag = int(1U << 31),
392 KRouteAccessVehicle = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessEmergencyVehicleFlag,
393 KRouteAccessNormal = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessPedestrianFlag
430 property bool Route {
bool get(); };
432 property bool Tunnel {
bool get();
void set(
bool); };
434 property bool Bridge {
bool get();
void set(
bool); };
436 property int Level {
int get();
void set(
int aLevel); };
440 property bool OneWay {
bool get();
void set(
bool aValue); };
446 property bool DriveOnLeft {
bool get();
void set(
bool aValue); };
448 property bool DriveOnRight {
bool get();
void set(
bool aValue); };
452 property bool Roundabout {
bool get();
void set(
bool aValue); };
454 property bool Toll {
bool get();
void set(
bool aValue); };
456 property bool WrongWay {
bool get();
void set(
bool aValue); };
458 property int SpeedLimit {
int get();
void set(
int aValue); };
460 property int Gradient {
int get();
void set(
int aValue); };
466 property bool CycleAccess {
bool get();
void set(
bool aValue); };
476 property int SubType {
int get();
void set(
int aValue); }
479 operator CartoTypeCore::FeatureInfo();
480 CartoTypeCore::FeatureInfo F() {
return CartoTypeCore::FeatureInfo::FromRawValue(m_value); }
482 template<
typename T>
Result SetValue(
bool aMustBeRoute,uint32_t aMask,uint32_t aShift,T aValue)
484 if (
Route == aMustBeRoute)
487 m_value |= ((uint32_t(aValue) << aShift) & aMask);
492 Result SetRouteFlag(uint32_t aFlag,
bool aValue)
505 static const uint32_t KRouteTypeCount = 32;
506 static const uint32_t KGradientCount = 8;
507 static const uint32_t KMaxSubType = 2047;
508 static const uint32_t KRouteAccessShift = 26;
509 static const uint32_t KRouteAccessMask = 63U << KRouteAccessShift;
510 static const uint32_t KRouteAccessWrongWayFlag = 1 << 26;
511 static const uint32_t KRouteAccessPedestrianFlag = 1 << 27;
512 static const uint32_t KRouteAccessCycleFlag = 1 << 28;
513 static const uint32_t KRouteAccessMotorVehicleFlag = 1 << 29;
514 static const uint32_t KRouteAccessEmergencyVehicleFlag = 1 << 30;
515 static const uint32_t KRouteAccessOtherFlag = 1U << 31;
516 static const uint32_t KRouteAccessVehicle = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessEmergencyVehicleFlag;
517 static const uint32_t KRouteAccessNormal = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessPedestrianFlag;
518 static const uint32_t KDiscriminatorMask = 3;
519 static const uint32_t KDiscriminatorNonRoute = 0;
520 static const uint32_t KDiscriminatorBridge = 1;
521 static const uint32_t KDiscriminatorTunnel = 2;
522 static const uint32_t KDiscriminatorRoute = 3;
523 static const uint32_t KLevelShift = 2;
524 static const uint32_t KLevelMask = 15 << KLevelShift;
525 static const uint32_t KTypeShift = 6;
526 static const uint32_t KRouteTypeMask = 31 << KTypeShift;
527 static const uint32_t KRouteOneWayFlag = 1 << 11;
528 static const uint32_t KRouteDriveOnLeftFlag = 1 << 12;
529 static const uint32_t KRouteRoundaboutFlag = 1 << 13;
530 static const uint32_t KRouteTollFlag = 1 << 14;
531 static const uint32_t KRouteSpeedLimitShift = 15;
532 static const uint32_t KRouteSpeedLimitMask = 255 << KRouteSpeedLimitShift;
533 static const uint32_t KRouteGradientShift = 23;
534 static const uint32_t KRouteGradientMask = 7 << KRouteGradientShift;
535 static const uint32_t KRouteGradientDirectionFlag = 4 << KRouteGradientShift;
536 static const uint32_t KNonRouteTypeMask = 32767 << KTypeShift;
537 static const uint32_t KNonRouteSubTypeShift = 21;
538 static const uint32_t KNonRouteSubTypeMask = 2047U << KNonRouteSubTypeShift;
A structured address. Any field may be empty or null, but at least one field should be non-empty for ...
Definition: CartoTypeWrapper.h:931
Feature information for a map object, represented internally as a 32-bit value.
Definition: CartoTypeFeatureInfo.h:415
bool OneWayBackward
True if this is a one-way route in the direction opposite to the one in which the route is stored.
Definition: CartoTypeFeatureInfo.h:444
int SubType
The sub-type. Always 0 if this is a route. This property cannot be set for route objects.
Definition: CartoTypeFeatureInfo.h:476
bool Toll
True if this is a toll route. This property cannot be set for non-route objects.
Definition: CartoTypeFeatureInfo.h:454
FeatureDiscriminator Discriminator
Returns the feature discriminator.
Definition: CartoTypeFeatureInfo.h:428
bool DriveOnRight
Returns true if this is a two-way route and the rule of the road is to drive on the right....
Definition: CartoTypeFeatureInfo.h:448
bool PedestrianAccess
True if this is a route and pedestrian access is allowed. This property cannot be set for non-route o...
Definition: CartoTypeFeatureInfo.h:464
int SpeedLimit
The speed limit in kph. A value of zero indicates that no speed limit is known. This property cannot ...
Definition: CartoTypeFeatureInfo.h:458
bool CycleAccess
True if this is a route and cycle access is allowed. This property cannot be set for non-route object...
Definition: CartoTypeFeatureInfo.h:466
void ReverseOneWayDirection()
Reverses the one-way direction if this is a one-way route.
bool WrongWay
True if this is a route with a one-way direction opposite to the order of its points....
Definition: CartoTypeFeatureInfo.h:456
bool DriveOnLeft
True if this is a two-way route and the rule of the road is to drive on the left. The rule of the roa...
Definition: CartoTypeFeatureInfo.h:446
bool Route
True if this is a route.
Definition: CartoTypeFeatureInfo.h:430
void SetVehicleAccess(bool aValue)
Sets or clears the vehicle access flags. Throws an exception if this is not a route.
FeatureType Type
The feature type. Route objects can only be set to route types, and non-route objects to non-route ty...
Definition: CartoTypeFeatureInfo.h:438
bool Tunnel
True if this is a route that is a tunnel. Non-route objects cannot be made into tunnels.
Definition: CartoTypeFeatureInfo.h:432
bool Roundabout
True if this is a route that is part of a roundabout. This property cannot be set for non-route objec...
Definition: CartoTypeFeatureInfo.h:452
bool Bridge
True if this is a route that is a bridge. Non-route objects cannot be made into bridges.
Definition: CartoTypeFeatureInfo.h:434
FeatureInfo()
Creates a feature info object of type UnknownNonRoute.
bool OneWay
True if this is a one-way route. Non-route objects cannot be set as one-way.
Definition: CartoTypeFeatureInfo.h:440
FeatureInfo(FeatureType aType)
Creates a feature info object from a feature type.
bool IsPrivate
Returns true if this is a route and no normal access is allowed.
Definition: CartoTypeFeatureInfo.h:474
bool OtherAccessRestricted
True if this is a route and there are access restrictions other than those specified by the standard ...
Definition: CartoTypeFeatureInfo.h:472
bool EmergencyVehicleAccess
True if this is a route and emergency vehicle access is allowed. This property cannot be set for non-...
Definition: CartoTypeFeatureInfo.h:470
int Level
The level, which is in the range -8 ... 7.
Definition: CartoTypeFeatureInfo.h:436
bool MotorVehicleAccess
True if this is a route and motor vehicle access is allowed. This property cannot be set for non-rout...
Definition: CartoTypeFeatureInfo.h:468
bool OneWayForward
True if this is a one-way route in the direction in which the route is stored.
Definition: CartoTypeFeatureInfo.h:442
int Gradient
The gradient as a number in the range 0...7. Values 0...3 are uphill and 4...7 are downhill....
Definition: CartoTypeFeatureInfo.h:460
Information about an entire route.
Definition: CartoTypeWrapper.h:873
A path defining a set of open and closed curves.
Definition: CartoTypeGeometry.h:140
Definition: CartoTypeWrapper.h:69
Result
Result codes returned by CartoType API functions.
Definition: CartoTypeResult.h:15
@ Success
No error; a successful result.
@ ErrorInvalidArgument
This error is returned when an invalid argument has been given to a function.
FeatureConstants
Constants referring to the FeatureType and FeatureInfo classes.
Definition: CartoTypeFeatureInfo.h:376
@ KMaxSubType
The maximum value for the sub-type of a non-route object.
@ KRouteTypeCount
The number of feature types that are used for routes. These values are also indexes into the speed an...
@ KGradientCount
The number of gradients.
uint32_t constexpr FeatureTypeCode(int A, int B, int C)
Definition: CartoTypeFeatureInfo.h:16
@ Position
A flag used in Framework.Navigate to indicate that the position is valid.
FeatureType
Every map object has a feature type.
Definition: CartoTypeFeatureInfo.h:30
@ SkiNordic
The index for nordic ski trails in the speed, bonus and restriction override arrays.
@ LightRail
The index for light railways in the speed, bonus and restriction override arrays.
@ Waterway
The index for waterways in the speed, bonus and restriction override arrays.
@ TrunkRoad
The index for trunk roads in the speed, bonus and restriction override arrays.
@ Motorway
The index for motorways in the speed, bonus and restriction override arrays.
@ Bridleway
The index for bridleways in the speed, bonus and restriction override arrays.
@ AerialWay
The index for aerial ways in the speed, bonus and restriction override arrays.
@ Railway
The index for railways in the speed, bonus and restriction override arrays.
@ Subway
The index for subways in the speed, bonus and restriction override arrays.
@ Footway
The index for footways in the speed, bonus and restriction override arrays.
@ LivingStreet
The index for living streets in the speed, bonus and restriction override arrays.
@ PedestrianRoad
The index for pedestrian roads in the speed, bonus and restriction override arrays.
@ TrunkLink
The index for trunk road links in the speed, bonus and restriction override arrays.
@ UnpavedRoad
The index for unpaved roads in the speed, bonus and restriction override arrays.
@ PrimaryRoad
The index for primary roads in the speed, bonus and restriction override arrays.
@ Track
The index for tracks in the speed, bonus and restriction override arrays.
@ PassengerFerry
The index for passenger ferries in the speed, bonus and restriction override arrays.
@ OtherRoad
The index for other roads in the speed, bonus and restriction override arrays.
@ VehicularFerry
The index for vehicular ferries in the speed, bonus and restriction override arrays.
@ PrimaryLink
The index for primary road links in the speed, bonus and restriction override arrays.
@ MotorwayLink
The index for motorway links in the speed, bonus and restriction override arrays.
@ UnclassifiedRoad
The index for unclassified roads in the speed, bonus and restriction override arrays.
@ SkiDownhill
The index for downhill ski trails in the speed, bonus and restriction override arrays.
@ Cycleway
The index for cycleways in the speed, bonus and restriction override arrays.
@ SecondaryLink
The index for secondary road links in the speed, bonus and restriction override arrays.
@ UnknownRoute
The index for unknown routes in the speed, bonus and restriction override arrays.
@ SecondaryRoad
The index for secondary roads in the speed, bonus and restriction override arrays.
@ ResidentialRoad
The index for residential roads in the speed, bonus and restriction override arrays.
@ Steps
The index for steps in the speed, bonus and restriction override arrays.
@ TertiaryRoad
The index for tertiary roads in the speed, bonus and restriction override arrays.
@ ServiceRoad
The index for service roads in the speed, bonus and restriction override arrays.
FeatureDiscriminator
The feature discriminator stored in a FeatureInfo object.
Definition: CartoTypeFeatureInfo.h:363
@ TunnelRoute
A route that is a tunnel.
@ BridgeRoute
A route that is a bridge.