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.NoTurnCostsEncoder
absoluteBarriers, acceptBit, backwardBit, directionBitMask, 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_SPEED
K_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, setRegistered
public DataFlagEncoder()
public DataFlagEncoder(PMap properties)
public DataFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts)
public int defineWayBits(int index, int shift)
AbstractFlagEncoder
defineWayBits
in class AbstractFlagEncoder
shift
- bit offset for the first bit used by this encoderpublic long handleRelationTags(ReaderRelation relation, long oldRelationFlags)
AbstractFlagEncoder
handleRelationTags
in class AbstractFlagEncoder
public long acceptWay(ReaderWay way)
AbstractFlagEncoder
acceptWay
in class AbstractFlagEncoder
public AccessValue getAccessValue(long flags)
public long handleWayTags(ReaderWay way, long allowed, long relationFlags)
AbstractFlagEncoder
handleWayTags
in class AbstractFlagEncoder
public 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)
AbstractFlagEncoder
reverseFlags
in class AbstractFlagEncoder
public 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)
FlagEncoder
isForward
in interface FlagEncoder
isForward
in class AbstractFlagEncoder
public final boolean isBackward(EdgeIteratorState edge, int accessType)
public final boolean isBackward(long flags)
FlagEncoder
isBackward
in interface FlagEncoder
isBackward
in class AbstractFlagEncoder
public 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)
AbstractFlagEncoder
flagsDefault
in class AbstractFlagEncoder
public long setAccess(long flags, boolean forward, boolean backward)
FlagEncoder
setAccess
in interface FlagEncoder
setAccess
in class AbstractFlagEncoder
public long setSpeed(long flags, double speed)
FlagEncoder
setSpeed
in interface FlagEncoder
setSpeed
in class AbstractFlagEncoder
protected long setLowSpeed(long flags, double speed, boolean reverse)
setLowSpeed
in class AbstractFlagEncoder
public double getSpeed(long flags)
getSpeed
in interface FlagEncoder
getSpeed
in class AbstractFlagEncoder
public long setReverseSpeed(long flags, double speed)
FlagEncoder
setReverseSpeed
in interface FlagEncoder
setReverseSpeed
in class AbstractFlagEncoder
public double getReverseSpeed(long flags)
getReverseSpeed
in interface FlagEncoder
getReverseSpeed
in class AbstractFlagEncoder
public long setProperties(double speed, boolean forward, boolean backward)
FlagEncoder
setProperties
in interface FlagEncoder
setProperties
in class AbstractFlagEncoder
protected double getMaxSpeed(ReaderWay way)
getMaxSpeed
in class AbstractFlagEncoder
public double getMaxSpeed()
getMaxSpeed
in interface FlagEncoder
getMaxSpeed
in class AbstractFlagEncoder
public double getMaxPossibleSpeed()
public boolean supports(Class<?> feature)
FlagEncoder
supports
in interface FlagEncoder
supports
in class AbstractFlagEncoder
public 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 FlagEncoder
getAnnotation
in class AbstractFlagEncoder
protected String getPropertiesString()
getPropertiesString
in class AbstractFlagEncoder
public int getVersion()
public DataFlagEncoder.WeightingConfig createWeightingConfig(PMap pMap)
Copyright © 2012–2018. All rights reserved.