public class DataFlagEncoder extends AbstractFlagEncoder
Currently limited to motor vehicle but later could handle different modes like foot or bike too.
| Modifier and Type | Class and Description |
|---|---|
class |
DataFlagEncoder.WeightingConfig |
TurnCostEncoder.NoTurnCostsEncoderabsoluteBarriers, acceptBit, backwardBit, directionBitMask, edgeInExplorer, edgeOutExplorer, ferries, ferryBit, forwardBit, intendedValues, K_BACKWARD, K_FORWARD, LONG_TRIP_FERRY_SPEED, maxPossibleSpeed, oneways, potentialBarriers, properties, restrictedValues, restrictions, roundaboutBit, SHORT_TRIP_FERRY_SPEED, speedBits, speedEncoder, speedFactor, UNKNOWN_DURATION_FERRY_SPEEDK_ROUNDABOUT| Constructor and Description |
|---|
DataFlagEncoder() |
DataFlagEncoder(int speedBits,
double speedFactor,
int maxTurnCosts) |
DataFlagEncoder(PMap properties) |
| Modifier and Type | Method and Description |
|---|---|
long |
acceptWay(ReaderWay way)
Decide whether a way is routable for a given mode of travel.
|
DataFlagEncoder.WeightingConfig |
createWeightingConfig(PMap pMap)
This method creates a Config map out of the PMap.
|
int |
defineWayBits(int index,
int shift)
Defines bits used for edge flags used for access, speed etc.
|
long |
flagsDefault(boolean forward,
boolean backward)
Sets default flags with specified access.
|
int |
getAccessType(String accessStr) |
AccessValue |
getAccessValue(long flags) |
InstructionAnnotation |
getAnnotation(long flags,
Translation tr) |
double |
getHeight(EdgeIteratorState edge) |
int |
getHighway(EdgeIteratorState edge) |
String |
getHighwayAsString(EdgeIteratorState edge)
Do not use within weighting as this is suboptimal from performance point of view.
|
double |
getMaxPossibleSpeed() |
double |
getMaxSpeed() |
double |
getMaxspeed(EdgeIteratorState edge,
int accessType,
boolean reverse) |
protected double |
getMaxSpeed(ReaderWay way) |
protected String |
getPropertiesString() |
double |
getReverseSpeed(long flags) |
int |
getSpatialId(long flags)
This method returns the spatialId stored in the specified flags or -1 if not enabled for this encoder.
|
double |
getSpeed(long flags) |
int |
getSurface(EdgeIteratorState edge) |
String |
getSurfaceAsString(EdgeIteratorState edge) |
int |
getTransportMode(EdgeIteratorState edge) |
String |
getTransportModeAsString(EdgeIteratorState edge) |
double[] |
getTransportModeMap(Map<String,Double> map) |
int |
getVersion() |
double |
getWeight(EdgeIteratorState edge) |
double |
getWidth(EdgeIteratorState edge) |
long |
handleRelationTags(ReaderRelation relation,
long oldRelationFlags)
Analyze the properties of a relation and create the routing flags for the second read step.
|
long |
handleWayTags(ReaderWay way,
long allowed,
long relationFlags)
Analyze properties of a way and create the routing flags.
|
boolean |
isBackward(EdgeIteratorState edge,
int accessType) |
boolean |
isBackward(long flags)
Reports whether the edge is available in backward direction (i.e.
|
boolean |
isForward(EdgeIteratorState edge,
int accessType) |
boolean |
isForward(long flags)
Reports whether the edge is available in forward direction (i.e.
|
boolean |
isRoundabout(EdgeIteratorState edge) |
boolean |
isStoreHeight() |
boolean |
isStoreWeight() |
boolean |
isStoreWidth() |
boolean |
isTransportModeBridge(EdgeIteratorState edge) |
boolean |
isTransportModeFord(long flags) |
boolean |
isTransportModeTunnel(EdgeIteratorState edge) |
long |
reverseFlags(long flags)
Swapping directions means swapping bits which are dependent on the direction of an edge like
the access bits.
|
long |
setAccess(long flags,
boolean forward,
boolean backward)
Sets the access of the edge.
|
protected long |
setLowSpeed(long flags,
double speed,
boolean reverse) |
long |
setProperties(double speed,
boolean forward,
boolean backward)
Sets speed and access properties.
|
long |
setReverseSpeed(long flags,
double speed)
Sets the reverse speed in the flags.
|
long |
setSpatialId(long flags,
int id)
This method set the spatial ID (e.g.
|
DataFlagEncoder |
setSpatialRuleLookup(SpatialRuleLookup spatialRuleLookup) |
long |
setSpeed(long flags,
double speed)
Sets the speed in km/h.
|
DataFlagEncoder |
setStoreHeight(boolean storeHeight) |
DataFlagEncoder |
setStoreWeight(boolean storeWeight) |
DataFlagEncoder |
setStoreWidth(boolean storeWidth) |
static double |
stringToMeter(String value) |
static double |
stringToTons(String value) |
boolean |
supports(Class<?> feature)
Returns true if the feature class is supported like TurnWeighting or PriorityWeighting.
|
String |
toString() |
applyMaxSpeed, applyWayTags, defineNodeBits, defineRelationBits, defineTurnBits, equals, getConditionalTagInspector, getDouble, getFerrySpeed, getLong, getTurnCost, getTurnFlags, handleNodeTags, hashCode, init, isAccept, isBlockFords, isBool, isFerry, isRegistered, isTurnRestricted, parseSpeed, setBlockByDefault, setBlockFords, setBool, setConditionalTagInspector, setDouble, setLong, setRegisteredpublic DataFlagEncoder()
public DataFlagEncoder(PMap properties)
public DataFlagEncoder(int speedBits,
double speedFactor,
int maxTurnCosts)
public int defineWayBits(int index,
int shift)
AbstractFlagEncoderdefineWayBits in class AbstractFlagEncodershift - bit offset for the first bit used by this encoderpublic long handleRelationTags(ReaderRelation relation, long oldRelationFlags)
AbstractFlagEncoderhandleRelationTags in class AbstractFlagEncoderpublic long acceptWay(ReaderWay way)
AbstractFlagEncoderacceptWay in class AbstractFlagEncoderpublic AccessValue getAccessValue(long flags)
public long handleWayTags(ReaderWay way, long allowed, long relationFlags)
AbstractFlagEncoderhandleWayTags in class AbstractFlagEncoderpublic static double stringToTons(String value)
public static double stringToMeter(String value)
public int getSpatialId(long flags)
public long setSpatialId(long flags,
int id)
public long reverseFlags(long flags)
AbstractFlagEncoderreverseFlags in class AbstractFlagEncoderpublic int getHighway(EdgeIteratorState edge)
public String getHighwayAsString(EdgeIteratorState edge)
public int getSurface(EdgeIteratorState edge)
public String getSurfaceAsString(EdgeIteratorState edge)
public int getTransportMode(EdgeIteratorState edge)
public boolean isTransportModeTunnel(EdgeIteratorState edge)
public boolean isTransportModeBridge(EdgeIteratorState edge)
public boolean isTransportModeFord(long flags)
public String getTransportModeAsString(EdgeIteratorState edge)
public boolean isRoundabout(EdgeIteratorState edge)
public int getAccessType(String accessStr)
public final boolean isForward(EdgeIteratorState edge, int accessType)
public final boolean isForward(long flags)
FlagEncoderisForward in interface FlagEncoderisForward in class AbstractFlagEncoderpublic final boolean isBackward(EdgeIteratorState edge, int accessType)
public final boolean isBackward(long flags)
FlagEncoderisBackward in interface FlagEncoderisBackward in class AbstractFlagEncoderpublic double getMaxspeed(EdgeIteratorState edge, int accessType, boolean reverse)
public double getHeight(EdgeIteratorState edge)
public double getWeight(EdgeIteratorState edge)
public double getWidth(EdgeIteratorState edge)
public long flagsDefault(boolean forward,
boolean backward)
AbstractFlagEncoderflagsDefault in class AbstractFlagEncoderpublic long setAccess(long flags,
boolean forward,
boolean backward)
FlagEncodersetAccess in interface FlagEncodersetAccess in class AbstractFlagEncoderpublic long setSpeed(long flags,
double speed)
FlagEncodersetSpeed in interface FlagEncodersetSpeed in class AbstractFlagEncoderprotected long setLowSpeed(long flags,
double speed,
boolean reverse)
setLowSpeed in class AbstractFlagEncoderpublic double getSpeed(long flags)
getSpeed in interface FlagEncodergetSpeed in class AbstractFlagEncoderpublic long setReverseSpeed(long flags,
double speed)
FlagEncodersetReverseSpeed in interface FlagEncodersetReverseSpeed in class AbstractFlagEncoderpublic double getReverseSpeed(long flags)
getReverseSpeed in interface FlagEncodergetReverseSpeed in class AbstractFlagEncoderpublic long setProperties(double speed,
boolean forward,
boolean backward)
FlagEncodersetProperties in interface FlagEncodersetProperties in class AbstractFlagEncoderprotected double getMaxSpeed(ReaderWay way)
getMaxSpeed in class AbstractFlagEncoderpublic double getMaxSpeed()
getMaxSpeed in interface FlagEncodergetMaxSpeed in class AbstractFlagEncoderpublic double getMaxPossibleSpeed()
public boolean supports(Class<?> feature)
FlagEncodersupports in interface FlagEncodersupports in class AbstractFlagEncoderpublic DataFlagEncoder setStoreHeight(boolean storeHeight)
public boolean isStoreHeight()
public DataFlagEncoder setStoreWeight(boolean storeWeight)
public boolean isStoreWeight()
public DataFlagEncoder setStoreWidth(boolean storeWidth)
public boolean isStoreWidth()
public DataFlagEncoder setSpatialRuleLookup(SpatialRuleLookup spatialRuleLookup)
public InstructionAnnotation getAnnotation(long flags, Translation tr)
getAnnotation in interface FlagEncodergetAnnotation in class AbstractFlagEncoderprotected String getPropertiesString()
getPropertiesString in class AbstractFlagEncoderpublic int getVersion()
public DataFlagEncoder.WeightingConfig createWeightingConfig(PMap pMap)
Copyright © 2012–2018. All rights reserved.