CartoType Android API 8.8-7-gb35e4dc71
for Java development on Android
Public Member Functions | Static Public Attributes | List of all members
com.cartotype.FeatureInfo Class Reference

Public Member Functions

 FeatureInfo ()
 
 FeatureInfo (int aFeatureType)
 
 FeatureInfo (int aFeatureType, int aSubType)
 
FeatureDiscriminator discriminator ()
 
boolean route ()
 
boolean tunnel ()
 
int setTunnel (boolean aValue)
 
boolean bridge ()
 
int setBridge (boolean aValue)
 
int level ()
 
void setLevel (int aLevel)
 
int type ()
 
int setType (int aType)
 
boolean oneWay ()
 
boolean oneWayForward ()
 
boolean oneWayBackward ()
 
boolean driveOnLeft ()
 
boolean driveOnRight ()
 
int setDriveOnLeft (boolean aValue)
 
void reverseOneWayDirection ()
 
boolean roundabout ()
 
int setRoundabout (boolean aValue)
 
boolean toll ()
 
int setToll (boolean aValue)
 
boolean wrongWay ()
 
int setWrongWay (boolean aValue)
 
int speedLimit ()
 
int setSpeedLimit (int aValue)
 
int gradient ()
 
int setGradient (int aValue)
 
int setVehicleAccess (boolean aValue)
 
boolean pedestrianAccess ()
 
int setPedestrianAccess (boolean aValue)
 
boolean cycleAccess ()
 
int setCycleAccess (boolean aValue)
 
boolean motorVehicleAccess ()
 
int setMotorVehicleAccess (boolean aValue)
 
boolean emergencyVehicleAccess ()
 
int setEmergencyVehicleAccess (boolean aValue)
 
boolean otherAccessRestricted ()
 
int setOtherAccessRestricted (boolean aValue)
 
boolean isPrivate ()
 
int subType ()
 
int setSubType (int aValue)
 

Static Public Attributes

static final int KRouteTypeCount = 32
 
static final int KGradientCount = 8
 
static final int KMaxSubType = 2047
 
static final int KRouteAccessShift = 26
 
static final int KRouteAccessMask = 63 << KRouteAccessShift
 
static final int KRouteAccessWrongWayFlag = 1 << 26
 
static final int KRouteAccessPedestrianFlag = 1 << 27
 
static final int KRouteAccessCycleFlag = 1 << 28
 
static final int KRouteAccessMotorVehicleFlag = 1 << 29
 
static final int KRouteAccessEmergencyVehicleFlag = 1 << 30
 
static final int KRouteAccessOtherFlag = 1 << 31
 
static final int KRouteAccessVehicle = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessEmergencyVehicleFlag
 
static final int KRouteAccessNormal = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessPedestrianFlag
 

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() [1/3]

com.cartotype.FeatureInfo.FeatureInfo ( )

Creates a feature info object of type UnknownNonRoute.

◆ FeatureInfo() [2/3]

com.cartotype.FeatureInfo.FeatureInfo ( int  aFeatureType)

Creates a feature info object from a feature type.

◆ FeatureInfo() [3/3]

com.cartotype.FeatureInfo.FeatureInfo ( int  aFeatureType,
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.

Member Function Documentation

◆ bridge()

boolean com.cartotype.FeatureInfo.bridge ( )

Returns true if this is a route that is a bridge.

◆ cycleAccess()

boolean com.cartotype.FeatureInfo.cycleAccess ( )

Returns true if this is a route and cycle access is allowed.

◆ discriminator()

FeatureDiscriminator com.cartotype.FeatureInfo.discriminator ( )

Returns the feature discriminator.

◆ driveOnLeft()

boolean com.cartotype.FeatureInfo.driveOnLeft ( )

Returns true if this is a two-way route and the rule of the road is to drive on the left.

◆ driveOnRight()

boolean com.cartotype.FeatureInfo.driveOnRight ( )

Returns true if this is a two-way route and the rule of the road is to drive on the right.

◆ emergencyVehicleAccess()

boolean com.cartotype.FeatureInfo.emergencyVehicleAccess ( )

Returns true if this is a route and emergency vehicle access is allowed.

◆ gradient()

int com.cartotype.FeatureInfo.gradient ( )

Returns 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.

◆ isPrivate()

boolean com.cartotype.FeatureInfo.isPrivate ( )

Returns true if this is a route and no normal access is allowed.

◆ level()

int com.cartotype.FeatureInfo.level ( )

Returns the level, which is in the range -8 ... 7.

◆ motorVehicleAccess()

boolean com.cartotype.FeatureInfo.motorVehicleAccess ( )

Returns true if this is a route and motor vehicle access is allowed.

◆ oneWay()

boolean com.cartotype.FeatureInfo.oneWay ( )

Returns true if this is a one-way route.

◆ oneWayBackward()

boolean com.cartotype.FeatureInfo.oneWayBackward ( )

Returns true if this is a one-way route in the direction opposite to the one in which the route is stored.

◆ oneWayForward()

boolean com.cartotype.FeatureInfo.oneWayForward ( )

Returns true if this is a one-way route in the direction in which the route is stored.

◆ otherAccessRestricted()

boolean com.cartotype.FeatureInfo.otherAccessRestricted ( )

Returns true if this is a route and there are access restrictions other than those specified by the standard flags.

◆ pedestrianAccess()

boolean com.cartotype.FeatureInfo.pedestrianAccess ( )

Returns true if this is a route and pedestrian access is allowed.

◆ reverseOneWayDirection()

void com.cartotype.FeatureInfo.reverseOneWayDirection ( )

Reverses the one-way direction if this is a one-way route.

◆ roundabout()

boolean com.cartotype.FeatureInfo.roundabout ( )

Returns true if this is a route that is part of a roundabout.

◆ route()

boolean com.cartotype.FeatureInfo.route ( )

Returns true if this is a route.

◆ setBridge()

int com.cartotype.FeatureInfo.setBridge ( boolean  aValue)

Sets whether this route is a bridge or an ordinary route. Does nothing and returns an error code if this is not a route.

◆ setCycleAccess()

int com.cartotype.FeatureInfo.setCycleAccess ( boolean  aValue)

Allows or forbids cycle access. Does nothing and returns an error if this is not a route.

◆ setDriveOnLeft()

int com.cartotype.FeatureInfo.setDriveOnLeft ( boolean  aValue)

Sets the rule of the road. Does nothing and returns an error if this is not a route.

◆ setEmergencyVehicleAccess()

int com.cartotype.FeatureInfo.setEmergencyVehicleAccess ( boolean  aValue)

Allows or forbids emergency vehicle access. Does nothing and returns an error if this is not a route.

◆ setGradient()

int com.cartotype.FeatureInfo.setGradient ( int  aValue)

Sets the gradient. Does nothing and returns an error if this is not a route. Gradients are stored only in route arcs and not usually in other map objects.

◆ setLevel()

void com.cartotype.FeatureInfo.setLevel ( int  aLevel)

Sets the level, clamping it to the range -8 ... 7.

◆ setMotorVehicleAccess()

int com.cartotype.FeatureInfo.setMotorVehicleAccess ( boolean  aValue)

Allows or forbids motor vehicle access. Does nothing and returns an error if this is not a route.

◆ setOtherAccessRestricted()

int com.cartotype.FeatureInfo.setOtherAccessRestricted ( boolean  aValue)

Sets or clears the flag indicating that there are other access restrictions. Does nothing and returns an error if this is not a route.

◆ setPedestrianAccess()

int com.cartotype.FeatureInfo.setPedestrianAccess ( boolean  aValue)

Allows or forbids pedestrian access. Does nothing and returns an error if this is not a route.

◆ setRoundabout()

int com.cartotype.FeatureInfo.setRoundabout ( boolean  aValue)

Sets whether this route is part of a roundabout. Does nothing and returns an error if this is not a route.

◆ setSpeedLimit()

int com.cartotype.FeatureInfo.setSpeedLimit ( int  aValue)

Sets the speed limit in kph. A value of zero indicates that no speed limit is known. Does nothing and returns an error if this is not a route.

◆ setSubType()

int com.cartotype.FeatureInfo.setSubType ( int  aValue)

Sets the sub-type. Does nothing and returns an error if this is a route.

◆ setToll()

int com.cartotype.FeatureInfo.setToll ( boolean  aValue)

Sets whether this route is a toll route. Does nothing and returns an error if this is not a route.

◆ setTunnel()

int com.cartotype.FeatureInfo.setTunnel ( boolean  aValue)

Sets whether this route is a tunnel or an ordinary route. Does nothing and returns an error code if this is not a route.

◆ setType()

int com.cartotype.FeatureInfo.setType ( int  aType)

Sets the type. Does nothing and returns an error if this is a route and the new type is a non-route type, or vice versa.

◆ setVehicleAccess()

int com.cartotype.FeatureInfo.setVehicleAccess ( boolean  aValue)

Sets or clears the vehicle access flags. Does nothing and returns an error if this is not a route.

◆ setWrongWay()

int com.cartotype.FeatureInfo.setWrongWay ( boolean  aValue)

Sets whether this is a directed route arc going the wrong way along a one-way route. Does nothing and returns an error if this is not a route. Useful only in route calculation.

◆ speedLimit()

int com.cartotype.FeatureInfo.speedLimit ( )

Returns the speed limit in kph. A value of zero indicates that no speed limit is known.

◆ subType()

int com.cartotype.FeatureInfo.subType ( )

Returns the sub-type. Returns 0 if this is a route.

◆ toll()

boolean com.cartotype.FeatureInfo.toll ( )

Returns true if this is a toll route.

◆ tunnel()

boolean com.cartotype.FeatureInfo.tunnel ( )

Returns true if this is a route that is a tunnel.

◆ type()

int com.cartotype.FeatureInfo.type ( )

Returns the feature type.

◆ wrongWay()

boolean com.cartotype.FeatureInfo.wrongWay ( )

Returns true if this is a directed route arc going the wrong way along a one-way route. Useful only in route calculation.

Member Data Documentation

◆ KGradientCount

final int com.cartotype.FeatureInfo.KGradientCount = 8
static

The number of gradients.

◆ KMaxSubType

final int com.cartotype.FeatureInfo.KMaxSubType = 2047
static

The maximum value for the sub-type of a non-route object.

◆ KRouteAccessCycleFlag

final int com.cartotype.FeatureInfo.KRouteAccessCycleFlag = 1 << 28
static

A flag to forbid cycle access in a feature info object, or, in a vehicle type, to indicate a cyclist.

◆ KRouteAccessEmergencyVehicleFlag

final int com.cartotype.FeatureInfo.KRouteAccessEmergencyVehicleFlag = 1 << 30
static

A flag to forbid emergency vehicle access in a feature info object, or, in a vehicle type, to indicate an emergency vehicle.

◆ KRouteAccessMask

final int com.cartotype.FeatureInfo.KRouteAccessMask = 63 << KRouteAccessShift
static

A mask to select the route access flags.

◆ KRouteAccessMotorVehicleFlag

final int com.cartotype.FeatureInfo.KRouteAccessMotorVehicleFlag = 1 << 29
static

A flag to forbid motor vehicle access in a feature info object, or, in a vehicle type, to indicate a motor vehicle.

◆ KRouteAccessNormal

final int com.cartotype.FeatureInfo.KRouteAccessNormal = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessPedestrianFlag
static

A set of flags indicating normal access: that is, access for pedestrians, cyclists and motor vehicles.

◆ KRouteAccessOtherFlag

final int com.cartotype.FeatureInfo.KRouteAccessOtherFlag = 1 << 31
static

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.

◆ KRouteAccessPedestrianFlag

final int com.cartotype.FeatureInfo.KRouteAccessPedestrianFlag = 1 << 27
static

A flag to forbid pedestrian access in a feature info object, or, in a vehicle type, to indicate a pedestrian.

◆ KRouteAccessShift

final int com.cartotype.FeatureInfo.KRouteAccessShift = 26
static

The amount by which the route access flags are shifted.

◆ KRouteAccessVehicle

final int com.cartotype.FeatureInfo.KRouteAccessVehicle = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessEmergencyVehicleFlag
static

A set of flags covering all vehicles.

◆ KRouteAccessWrongWayFlag

final int com.cartotype.FeatureInfo.KRouteAccessWrongWayFlag = 1 << 26
static

A flag indicating that this route is one-way but is stored in the opposite direction to the allowed direction of travel.

◆ KRouteTypeCount

final int com.cartotype.FeatureInfo.KRouteTypeCount = 32
static

The number of feature types that are used for routes. These values are also indexes into the speed and bonus arrays in route profiles.


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