public abstract class AbstractFlagEncoder extends Object implements FlagEncoder
EncodingManager| Modifier and Type | Field and Description |
|---|---|
protected BooleanEncodedValue |
accessEnc |
protected DecimalEncodedValue |
avgSpeedEnc |
protected Set<String> |
barriers |
protected EncodedValueLookup |
encodedValueLookup |
protected Set<String> |
ferries |
protected FerrySpeedCalculator |
ferrySpeedCalc |
protected Set<String> |
intendedValues |
protected double |
maxPossibleSpeed |
protected Set<String> |
oneways |
protected Set<String> |
restrictedValues |
protected List<String> |
restrictions |
protected BooleanEncodedValue |
roundaboutEnc |
protected int |
speedBits |
protected double |
speedFactor |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFlagEncoder(int speedBits,
double speedFactor,
int maxTurnCosts) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyWayTags(ReaderWay way,
EdgeIteratorState edge)
Second parsing step.
|
protected void |
blockFords(boolean blockFords) |
protected void |
blockPrivate(boolean blockPrivate) |
void |
createEncodedValues(List<EncodedValue> registerNewEncodedValue)
Defines bits used for edge flags used for access, speed etc.
|
abstract EncodingManager.Access |
getAccess(ReaderWay way)
Decide whether a way is routable for a given mode of travel.
|
BooleanEncodedValue |
getAccessEnc()
This method returns the EncodedValue used for the direction-dependent access properties of this encoder.
|
DecimalEncodedValue |
getAverageSpeedEnc()
This method returns the EncodedValue used for the average speed of this encoder.
|
BooleanEncodedValue |
getBooleanEncodedValue(String key) |
ConditionalTagInspector |
getConditionalTagInspector() |
DecimalEncodedValue |
getDecimalEncodedValue(String key) |
<T extends EncodedValue> |
getEncodedValue(String key,
Class<T> encodedValueType) |
List<EncodedValue> |
getEncodedValues() |
<T extends Enum<?>> |
getEnumEncodedValue(String key,
Class<T> enumType) |
IntEncodedValue |
getIntEncodedValue(String key) |
double |
getMaxSpeed() |
protected double |
getMaxSpeed(ReaderWay way) |
int |
getMaxTurnCosts() |
abstract String |
getName() |
protected String |
getPropertiesString() |
List<String> |
getRestrictions() |
StringEncodedValue |
getStringEncodedValue(String key) |
IntsRef |
handleNodeTags(IntsRef edgeFlags,
Map<String,Object> nodeTags)
Updates the given edge flags based on node tags
|
abstract IntsRef |
handleWayTags(IntsRef edgeFlags,
ReaderWay way)
Analyze properties of a way and create the edge flags.
|
boolean |
hasEncodedValue(String key) |
protected void |
init(DateRangeParser dateRangeParser) |
boolean |
isBarrier(ReaderNode node) |
boolean |
isBlockFords() |
boolean |
isRegistered() |
protected boolean |
isValidSpeed(double speed) |
protected void |
setConditionalTagInspector(ConditionalTagInspector inspector) |
void |
setEncodedValueLookup(EncodedValueLookup encodedValueLookup) |
protected void |
setSpeed(boolean reverse,
IntsRef edgeFlags,
double speed) |
boolean |
supports(Class<?> feature)
Returns true if the feature class is supported like TurnWeighting or PriorityWeighting.
|
boolean |
supportsTurnCosts() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTransportationModeprotected final int speedBits
protected final double speedFactor
protected BooleanEncodedValue accessEnc
protected BooleanEncodedValue roundaboutEnc
protected DecimalEncodedValue avgSpeedEnc
protected double maxPossibleSpeed
protected EncodedValueLookup encodedValueLookup
protected FerrySpeedCalculator ferrySpeedCalc
protected AbstractFlagEncoder(int speedBits,
double speedFactor,
int maxTurnCosts)
speedBits - specify the number of bits used for speedspeedFactor - specify the factor to multiple the stored value (can be used to increase
or decrease accuracy of speed value)maxTurnCosts - specify the maximum value used for turn costs, if this value is reached a
turn is forbidden and results in costs of positive infinity.protected void init(DateRangeParser dateRangeParser)
protected void setConditionalTagInspector(ConditionalTagInspector inspector)
public boolean isRegistered()
isRegistered in interface FlagEncoderpublic boolean isBlockFords()
protected void blockFords(boolean blockFords)
protected void blockPrivate(boolean blockPrivate)
public ConditionalTagInspector getConditionalTagInspector()
public void createEncodedValues(List<EncodedValue> registerNewEncodedValue)
public abstract IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way)
public IntsRef handleNodeTags(IntsRef edgeFlags, Map<String,Object> nodeTags)
public int getMaxTurnCosts()
public abstract EncodingManager.Access getAccess(ReaderWay way)
public boolean isBarrier(ReaderNode node)
public double getMaxSpeed()
getMaxSpeed in interface FlagEncoderprotected double getMaxSpeed(ReaderWay way)
Double.NaN if no maxspeed foundprotected boolean isValidSpeed(double speed)
Double.NaNpublic void applyWayTags(ReaderWay way, EdgeIteratorState edge)
public final DecimalEncodedValue getAverageSpeedEnc()
FlagEncodergetAverageSpeedEnc in interface FlagEncoderpublic final BooleanEncodedValue getAccessEnc()
FlagEncodergetAccessEnc in interface FlagEncoderprotected void setSpeed(boolean reverse,
IntsRef edgeFlags,
double speed)
protected String getPropertiesString()
public List<EncodedValue> getEncodedValues()
getEncodedValues in interface EncodedValueLookuppublic <T extends EncodedValue> T getEncodedValue(String key, Class<T> encodedValueType)
getEncodedValue in interface EncodedValueLookuppublic BooleanEncodedValue getBooleanEncodedValue(String key)
getBooleanEncodedValue in interface EncodedValueLookuppublic IntEncodedValue getIntEncodedValue(String key)
getIntEncodedValue in interface EncodedValueLookuppublic DecimalEncodedValue getDecimalEncodedValue(String key)
getDecimalEncodedValue in interface EncodedValueLookuppublic <T extends Enum<?>> EnumEncodedValue<T> getEnumEncodedValue(String key, Class<T> enumType)
getEnumEncodedValue in interface EncodedValueLookuppublic StringEncodedValue getStringEncodedValue(String key)
getStringEncodedValue in interface EncodedValueLookuppublic void setEncodedValueLookup(EncodedValueLookup encodedValueLookup)
public boolean supportsTurnCosts()
supportsTurnCosts in interface FlagEncoderpublic boolean supports(Class<?> feature)
FlagEncodersupports in interface FlagEncoderpublic boolean hasEncodedValue(String key)
hasEncodedValue in interface EncodedValueLookuppublic abstract String getName()
Copyright © 2012–2022. All rights reserved.