public class EncodingManager extends Object implements EncodedValueLookup
EncodingManager.start(4).add(new CarFlagEncoder()).build();
Modifier and Type | Class and Description |
---|---|
static class |
EncodingManager.AcceptWay |
static class |
EncodingManager.Access |
static class |
EncodingManager.Builder |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptWay(ReaderWay way,
EncodingManager.AcceptWay acceptWay)
Determine whether a way is routable for one of the added encoders.
|
void |
applyWayTags(ReaderWay way,
EdgeIteratorState edge) |
static EncodingManager |
create(EncodedValueFactory evFactory,
FlagEncoderFactory flagEncoderFactory,
String ghLoc)
Create the EncodingManager from the provided GraphHopper location.
|
static EncodingManager |
create(FlagEncoder... flagEncoders)
Instantiate manager with the given list of encoders.
|
static EncodingManager |
create(FlagEncoderFactory factory,
String flagEncodersStr) |
static EncodingManager |
create(List<? extends FlagEncoder> flagEncoders)
Instantiate manager with the given list of encoders.
|
static EncodingManager |
create(String flagEncodersStr)
Instantiate manager with the given list of encoders.
|
IntsRef |
createEdgeFlags() |
IntsRef |
createRelationFlags() |
boolean |
equals(Object o) |
List<FlagEncoder> |
fetchEdgeEncoders() |
IntsRef |
flagsDefault(boolean forward,
boolean backward) |
List<BooleanEncodedValue> |
getAccessEncFromNodeFlags(long importNodeFlags) |
List<EncodedValue> |
getAllShared() |
BooleanEncodedValue |
getBooleanEncodedValue(String key) |
DecimalEncodedValue |
getDecimalEncodedValue(String key) |
<T extends EncodedValue> |
getEncodedValue(String key,
Class<T> encodedValueType) |
FlagEncoder |
getEncoder(String name) |
<T extends Enum> |
getEnumEncodedValue(String key,
Class<T> type) |
IntEncodedValue |
getIntEncodedValue(String key) |
int |
getIntsForFlags() |
static String |
getKey(FlagEncoder encoder,
String str)
All EncodedValue names that are created from a FlagEncoder should use this method to mark them as
"none-shared" across the other FlagEncoders.
|
static String |
getKey(String prefix,
String str) |
long |
handleNodeTags(ReaderNode node)
Analyze tags on osm node.
|
IntsRef |
handleRelationTags(ReaderRelation relation,
IntsRef relFlags) |
void |
handleTurnRelationTags(OSMTurnRelation turnRelation,
TurnCostParser.ExternalInternalMap map,
Graph graph) |
IntsRef |
handleWayTags(ReaderWay way,
EncodingManager.AcceptWay acceptWay,
IntsRef relationFlags)
Processes way properties of different kind to determine speed and direction.
|
boolean |
hasEncodedValue(String key) |
boolean |
hasEncoder(String encoder) |
int |
hashCode() |
boolean |
isEnableInstructions() |
boolean |
needsTurnCostsSupport() |
void |
releaseParsers() |
static EncodingManager.Builder |
start()
Starts the build process of an EncodingManager
|
String |
toEncodedValuesAsString() |
String |
toFlagEncodersAsString() |
String |
toString() |
public static EncodingManager create(String flagEncodersStr)
flagEncodersStr
- comma delimited list of encoders. The order does not matter.public static EncodingManager create(FlagEncoderFactory factory, String flagEncodersStr)
public static EncodingManager create(FlagEncoder... flagEncoders)
flagEncoders
- comma delimited list of encoders. The order does not matter.public static EncodingManager create(List<? extends FlagEncoder> flagEncoders)
flagEncoders
- comma delimited list of encoders. The order does not matter.public static EncodingManager create(EncodedValueFactory evFactory, FlagEncoderFactory flagEncoderFactory, String ghLoc)
public static EncodingManager.Builder start()
public void releaseParsers()
public int getIntsForFlags()
public boolean isEnableInstructions()
public boolean hasEncodedValue(String key)
hasEncodedValue
in interface EncodedValueLookup
public boolean hasEncoder(String encoder)
public FlagEncoder getEncoder(String name)
public boolean acceptWay(ReaderWay way, EncodingManager.AcceptWay acceptWay)
public IntsRef handleRelationTags(ReaderRelation relation, IntsRef relFlags)
public void handleTurnRelationTags(OSMTurnRelation turnRelation, TurnCostParser.ExternalInternalMap map, Graph graph)
public IntsRef handleWayTags(ReaderWay way, EncodingManager.AcceptWay acceptWay, IntsRef relationFlags)
relationFlags
- The preprocessed relation flags is used to influence the way properties.public String toFlagEncodersAsString()
public String toEncodedValuesAsString()
public IntsRef createEdgeFlags()
public IntsRef createRelationFlags()
public IntsRef flagsDefault(boolean forward, boolean backward)
public long handleNodeTags(ReaderNode node)
public void applyWayTags(ReaderWay way, EdgeIteratorState edge)
public List<FlagEncoder> fetchEdgeEncoders()
public boolean needsTurnCostsSupport()
public List<BooleanEncodedValue> getAccessEncFromNodeFlags(long importNodeFlags)
public List<EncodedValue> getAllShared()
getAllShared
in interface EncodedValueLookup
public BooleanEncodedValue getBooleanEncodedValue(String key)
getBooleanEncodedValue
in interface EncodedValueLookup
public IntEncodedValue getIntEncodedValue(String key)
getIntEncodedValue
in interface EncodedValueLookup
public DecimalEncodedValue getDecimalEncodedValue(String key)
getDecimalEncodedValue
in interface EncodedValueLookup
public <T extends Enum> EnumEncodedValue<T> getEnumEncodedValue(String key, Class<T> type)
getEnumEncodedValue
in interface EncodedValueLookup
public <T extends EncodedValue> T getEncodedValue(String key, Class<T> encodedValueType)
getEncodedValue
in interface EncodedValueLookup
public static String getKey(FlagEncoder encoder, String str)
Copyright © 2012–2020. All rights reserved.