CartoType .NET API 8.8-7-gb35e4dc71
for development in C#, Visual Basic and other .NET languages
Public Member Functions | Public Attributes | Properties | List of all members
CartoType::FeatureInfo Class Reference

Feature information for a map object, represented internally as a 32-bit value. More...

#include <CartoTypeFeatureInfo.h>

Public Member Functions

 FeatureInfo ()
 Creates a feature info object of type UnknownNonRoute.
 
 FeatureInfo (FeatureType aType)
 Creates a feature info object from a feature type.
 
 FeatureInfo (FeatureType aType, int aSubType)
 Creates a feature info object with a given sub-type. The sub-type is clamped to the range 0...2047, and is ignored if aType is a route type, because routes do not have sub-types.
 
 FeatureInfo (int aSubType)
 
void ReverseOneWayDirection ()
 Reverses the one-way direction if this is a one-way route.
 
void SetVehicleAccess (bool aValue)
 Sets or clears the vehicle access flags. Throws an exception if this is not a route.
 

Public Attributes

literal int KRouteTypeCount = 32
 The number of feature types that are used for routes. These values are also indexes into the speed and bonus arrays in route profiles.
 
literal int KGradientCount = 8
 The number of gradients.
 
literal int KMaxSubType = 2047
 The maximum value for the sub-type of a non-route object.
 
literal int KRouteAccessShift = 26
 The amount by which the route access flags are shifted.
 
literal int KRouteAccessMask = 63U << KRouteAccessShift
 A mask to select the route access flags.
 
literal int KRouteAccessWrongWayFlag = 1 << 26
 A flag indicating that this route is one-way but is stored in the opposite direction to the allowed direction of travel.
 
literal int KRouteAccessPedestrianFlag = 1 << 27
 A flag to forbid pedestrian access in a feature info object, or, in a vehicle type, to indicate a pedestrian.
 
literal int KRouteAccessCycleFlag = 1 << 28
 A flag to forbid cycle access in a feature info object, or, in a vehicle type, to indicate a cyclist.
 
literal int KRouteAccessMotorVehicleFlag = 1 << 29
 A flag to forbid motor vehicle access in a feature info object, or, in a vehicle type, to indicate a motor vehicle.
 
literal int KRouteAccessEmergencyVehicleFlag = 1 << 30
 A flag to forbid emergency vehicle access in a feature info object, or, in a vehicle type, to indicate an emergency vehicle.
 
literal int KRouteAccessOtherFlag = 1U << 31
 A flag to indicate the presence of other access restrictions in a feature info object, or, in a vehicle type, to indicate a type of vehicle not covered by the other flags.
 
literal int KRouteAccessVehicle = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessEmergencyVehicleFlag
 A set of flags covering all vehicles.
 
literal int KRouteAccessNormal = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessPedestrianFlag
 A set of flags indicating normal access: that is, access for pedestrians, cyclists and motor vehicles.
 

Properties

FeatureDiscriminator Discriminator [get]
 Returns the feature discriminator.
 
bool Route [get]
 True if this is a route.
 
bool Tunnel [get, set]
 True if this is a route that is a tunnel. Non-route objects cannot be made into tunnels.
 
bool Bridge [get, set]
 True if this is a route that is a bridge. Non-route objects cannot be made into bridges.
 
int Level [get, set]
 The level, which is in the range -8 ... 7.
 
FeatureType Type [get, set]
 The feature type. Route objects can only be set to route types, and non-route objects to non-route types.
 
bool OneWay [get, set]
 True if this is a one-way route. Non-route objects cannot be set as one-way.
 
bool OneWayForward [get]
 True if this is a one-way route in the direction in which the route is stored.
 
bool OneWayBackward [get]
 True if this is a one-way route in the direction opposite to the one in which the route is stored.
 
bool DriveOnLeft [get, set]
 True if this is a two-way route and the rule of the road is to drive on the left. The rule of the road cannot be set for non-route objects.
 
bool DriveOnRight [get, set]
 Returns true if this is a two-way route and the rule of the road is to drive on the right. The rule of the road cannot be set for non-route objects.
 
bool Roundabout [get, set]
 True if this is a route that is part of a roundabout. This property cannot be set for non-route objects.
 
bool Toll [get, set]
 True if this is a toll route. This property cannot be set for non-route objects.
 
bool WrongWay [get, set]
 True if this is a route with a one-way direction opposite to the order of its points. This property cannot be set for non-route objects.
 
int SpeedLimit [get, set]
 The speed limit in kph. A value of zero indicates that no speed limit is known. This property cannot be set for non-route objects.
 
int Gradient [get, set]
 The gradient as a number in the range 0...7. Values 0...3 are uphill and 4...7 are downhill. Gradients are stored only in route arcs and not usually in other map objects. This property cannot be set for non-route objects.
 
bool PedestrianAccess [get, set]
 True if this is a route and pedestrian access is allowed. This property cannot be set for non-route objects.
 
bool CycleAccess [get, set]
 True if this is a route and cycle access is allowed. This property cannot be set for non-route objects.
 
bool MotorVehicleAccess [get, set]
 True if this is a route and motor vehicle access is allowed. This property cannot be set for non-route objects.
 
bool EmergencyVehicleAccess [get, set]
 True if this is a route and emergency vehicle access is allowed. This property cannot be set for non-route objects.
 
bool OtherAccessRestricted [get, set]
 True if this is a route and there are access restrictions other than those specified by the standard flags. This property cannot be set for non-route objects.
 
bool IsPrivate [get]
 Returns true if this is a route and no normal access is allowed.
 
int SubType [get, set]
 The sub-type. Always 0 if this is a route. This property cannot be set for route objects.
 

Detailed Description

Feature information for a map object, represented internally as a 32-bit value.

Every map object has a feature info value. Feature info values fall into two categories: route and non-route.

Route values have a feature type in the range 0...31 (Motorway...UnknownRoute); it is used as the index into the speed and bonus arrays in a route profile. Route values have other information relevant to routing including the speed limit and access restrictions.

Non-route values have a feature type in the range 32...32767. Non-route feature types, apart from the special values UnknownNonRoute (32) and Invalid (32767), may be expressed as three-letter mnemonics, which can be constructed using the FeatureTypeCode function. Non-route values have an 11-bit sub-type that may be used for fine distinctions such as settlement rank or boundary type.

Both route and non-route values have a level in the range -8...7, where 0 represents ground level. The level is used as one of the criteria determining drawing order.

Constructor & Destructor Documentation

◆ FeatureInfo()

CartoType::FeatureInfo::FeatureInfo ( int  aSubType)

Creates a non-route feature info object of type UnknownNonRoute and a given sub-type. The sub-type is clamped to the range 0...2047.


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