public class StreetEdge extends Edge implements Cloneable
Edge.ValidVertexTypes
Modifier and Type | Field and Description |
---|---|
static int |
ANY_PLATFORM_MASK |
protected float |
bicycleSafetyFactor
bicycleSafetyWeight = length * bicycleSafetyFactor.
|
static int |
CLASS_CROSSING |
static int |
CLASS_LINK |
static int |
CLASS_OTHER_PLATFORM |
static int |
CLASS_OTHERPATH |
static int |
CLASS_STREET |
static int |
CLASS_TRAIN_PLATFORM |
static int |
CROSSING_CLASS_MASK |
static float |
DEFAULT_CAR_SPEED |
protected float |
walkComfortScore
The walk comfort score.
|
long |
wayId
The OSM way ID from whence this came - needed to reference traffic data
|
Constructor and Description |
---|
StreetEdge(StreetVertex v1,
StreetVertex v2,
org.locationtech.jts.geom.LineString geometry,
I18NString name,
double length,
StreetTraversalPermission permission,
boolean back) |
StreetEdge(StreetVertex v1,
StreetVertex v2,
org.locationtech.jts.geom.LineString geometry,
String name,
double length,
StreetTraversalPermission permission,
boolean back) |
Modifier and Type | Method and Description |
---|---|
boolean |
addCarNetwork(String carNetwork) |
boolean |
addVehicleNetwork(String vehicleNetwork) |
protected void |
calculateLengthFromGeometry()
calculate the length of this street segement from its geometry
|
static double |
calculateMicromobilitySpeed(double watts,
double weight,
double beta,
double coefficientOfRollingResistance,
double aerodynamicDragComponent,
double minSpeed,
double maxSpeed)
Calculate the approximate speed for a vehicle given slope data, available sustained power output, weight, rolling
resistance, aerodynamic drag and bounds on min/max speeds.
|
double |
calculateSpeed(RoutingRequest options,
TraverseMode traverseMode,
long timeMillis)
Calculate the speed appropriately given the RoutingRequest and traverseMode and the current wall clock time.
|
boolean |
canTraverse(TraverseModeSet modes)
Checks permissions of the street edge if specified modes are allowed to travel.
|
boolean |
canTraverseIncludingBarrier(TraverseMode mode)
This checks if start or end vertex is bollard
If it is it creates intersection of street edge permissions
and from/to barriers.
|
boolean |
canTurnOnto(Edge e,
State state,
TraverseMode mode) |
StreetEdge |
clone() |
boolean |
containsCarNetwork(String carNetwork) |
boolean |
containsVehicleNetwork(String vehicleNetwork) |
float |
getBicycleSafetyFactor() |
Set<String> |
getCarNetworks() |
float |
getCarSpeed() |
double |
getDistance() |
PackedCoordinateSequence |
getElevationProfile() |
long |
getEndOsmNodeId()
Get the ending OSM node ID of this edge.
|
boolean |
getFloatingCarDropoffSuitability() |
boolean |
getFloatingVehicleDropoffSuitability() |
org.locationtech.jts.geom.LineString |
getGeometry() |
int |
getInAngle()
Return the azimuth of the first segment in this edge in integer degrees clockwise from South.
|
float |
getMaxSlope() |
String |
getName()
Gets english localized name
|
String |
getName(Locale locale)
Gets wanted localization
|
Map<String,String> |
getOsmTags() |
int |
getOutAngle()
Return the azimuth of the last segment in this edge in integer degrees clockwise from South.
|
StreetTraversalPermission |
getPermission() |
I18NString |
getRawName()
Gets non-localized I18NString (Used when splitting edges)
|
double |
getRollingResistanceCoefficient() |
double |
getSlopeSpeedEffectiveLength() |
double |
getSlopeWalkSpeedEffectiveLength() |
double |
getSlopeWorkCostEffectiveLength() |
long |
getStartOsmNodeId()
Get the starting OSM node ID of this edge.
|
int |
getStreetClass() |
boolean |
getTNCStopSuitability() |
protected List<TurnRestriction> |
getTurnRestrictions(Graph graph) |
Set<String> |
getVehicleNetworks() |
float |
getWalkComfortScore() |
boolean |
hasBogusName() |
boolean |
isBack()
Marks that this edge is the reverse of the one defined in the source
data.
|
boolean |
isElevationFlattened() |
boolean |
isNoThruTraffic() |
boolean |
isRoundabout()
Edges are not roundabouts by default.
|
boolean |
isSlopeOverride() |
boolean |
isStairs()
This street is a staircase
|
boolean |
isWheelchairAccessible() |
void |
setBack(boolean back) |
void |
setBicycleSafetyFactor(float bicycleSafetyFactor) |
void |
setCarNetworks(Set<String> networks) |
void |
setCarSpeed(float carSpeed) |
void |
setFloatingCarDropoffSuitability(boolean isSuitable) |
void |
setFloatingVehicleDropoffSuitability(boolean isSuitable) |
void |
setHasBogusName(boolean hasBogusName) |
void |
setName(I18NString name) |
void |
setNoThruTraffic(boolean noThruTraffic) |
void |
setOsmTags(Map<String,String> osmTags) |
void |
setPermission(StreetTraversalPermission permission) |
void |
setRoundabout(boolean roundabout) |
void |
setSlopeOverride(boolean slopeOverride) |
void |
setStairs(boolean stairs) |
void |
setStreetClass(int streetClass) |
void |
setTNCStopSuitability(boolean isSuitable) |
void |
setVehicleNetworks(Set<String> networks) |
void |
setWalkComfortScore(float walkComfortScore) |
void |
setWheelchairAccessible(boolean wheelchairAccessible) |
void |
shareData(StreetEdge reversedEdge) |
P2<StreetEdge> |
split(SplitterVertex splitterVertex,
boolean destructive,
boolean createSemiPermanentEdges)
Split this street edge and return the resulting street edges.
|
double |
timeLowerBound(RoutingRequest options)
Returns a lower bound on traversal time given the routing options.
|
String |
toString() |
State |
traverse(State s0)
Traverse this edge.
|
double |
weightLowerBound(RoutingRequest options)
Returns a lower bound on edge weight given the routing options.
|
getAzimuth, getDirection, getDisplayGeometry, getFromVertex, getId, getToVertex, getTrip, getValidVertexTypes, hashCode, isEquivalentTo, isPartial, isReverseOf, optimisticTraverse, vertexTypesValid
public static final int CLASS_STREET
public static final int CLASS_CROSSING
public static final int CLASS_OTHERPATH
public static final int CLASS_OTHER_PLATFORM
public static final int CLASS_TRAIN_PLATFORM
public static final int ANY_PLATFORM_MASK
public static final int CROSSING_CLASS_MASK
public static final int CLASS_LINK
public static final float DEFAULT_CAR_SPEED
protected float bicycleSafetyFactor
public long wayId
protected float walkComfortScore
public StreetEdge(StreetVertex v1, StreetVertex v2, org.locationtech.jts.geom.LineString geometry, I18NString name, double length, StreetTraversalPermission permission, boolean back)
public StreetEdge(StreetVertex v1, StreetVertex v2, org.locationtech.jts.geom.LineString geometry, String name, double length, StreetTraversalPermission permission, boolean back)
public boolean canTraverse(TraverseModeSet modes)
modes
- public boolean canTraverseIncludingBarrier(TraverseMode mode)
canTraverse(RoutingRequest, TraverseMode)
mode
- public PackedCoordinateSequence getElevationProfile()
public boolean isElevationFlattened()
public float getMaxSlope()
public double getDistance()
getDistance
in class Edge
public double calculateSpeed(RoutingRequest options, TraverseMode traverseMode, long timeMillis)
public double getRollingResistanceCoefficient()
public double weightLowerBound(RoutingRequest options)
Edge
weightLowerBound
in class Edge
public double timeLowerBound(RoutingRequest options)
Edge
timeLowerBound
in class Edge
public static double calculateMicromobilitySpeed(double watts, double weight, double beta, double coefficientOfRollingResistance, double aerodynamicDragComponent, double minSpeed, double maxSpeed)
watts
- The sustained power output in watts. This represents the value of `P` in the above equations.weight
- The total weight required to be moved that includes the rider(s), their belongings and the vehicle
weight.beta
- ("beta") Inclination angle, = arctan(grade/100). It's probably not a huge time savings and would use
more memory, but additional precalculations from this value could be made. This value is used to
calculate the values of `Crvn` and `Frg` as noted in the above equations.coefficientOfRollingResistance
- The coefficient of rolling resistance. This can also be used to model the
difficulty of traveling over bumpy roadways. This value is used to calculate the value of `Frg` as
noted in the above equations.See this wikipedia page for a list of coefficients by various surface
types: https://en.wikipedia.org/wiki/Rolling_resistance#Rolling_resistance_coefficient_examplesaerodynamicDragComponent
- The product of the coefficient of aerodynamic drag, frontal area and air density.
This value is product of (Cd * A * ρ) as noted in the above mathematical equations.minSpeed
- The minimum speed that the micromobility should travel at in cases where the slope is so steep
that it would be faster to walk with the vehicle.maxSpeed
- The maximum speed the vehicle can travel at.public double getSlopeSpeedEffectiveLength()
public double getSlopeWorkCostEffectiveLength()
public double getSlopeWalkSpeedEffectiveLength()
public void setBicycleSafetyFactor(float bicycleSafetyFactor)
public float getBicycleSafetyFactor()
public void setWalkComfortScore(float walkComfortScore)
public float getWalkComfortScore()
public StreetEdge clone()
public boolean canTurnOnto(Edge e, State state, TraverseMode mode)
public I18NString getRawName()
public String getName(Locale locale)
Edge
public void setName(I18NString name)
public org.locationtech.jts.geom.LineString getGeometry()
getGeometry
in class Edge
public void shareData(StreetEdge reversedEdge)
public boolean isWheelchairAccessible()
public void setWheelchairAccessible(boolean wheelchairAccessible)
public StreetTraversalPermission getPermission()
public void setPermission(StreetTraversalPermission permission)
public int getStreetClass()
public void setStreetClass(int streetClass)
public boolean isBack()
public void setBack(boolean back)
public boolean isRoundabout()
Edge
isRoundabout
in class Edge
public void setRoundabout(boolean roundabout)
public boolean hasBogusName()
hasBogusName
in class Edge
public void setHasBogusName(boolean hasBogusName)
public boolean isNoThruTraffic()
public void setNoThruTraffic(boolean noThruTraffic)
public boolean isStairs()
public void setStairs(boolean stairs)
public float getCarSpeed()
public void setCarSpeed(float carSpeed)
public void setTNCStopSuitability(boolean isSuitable)
public boolean getTNCStopSuitability()
public void setFloatingCarDropoffSuitability(boolean isSuitable)
public boolean getFloatingCarDropoffSuitability()
public void setFloatingVehicleDropoffSuitability(boolean isSuitable)
public boolean getFloatingVehicleDropoffSuitability()
public boolean isSlopeOverride()
public void setSlopeOverride(boolean slopeOverride)
public int getInAngle()
public int getOutAngle()
protected List<TurnRestriction> getTurnRestrictions(Graph graph)
protected void calculateLengthFromGeometry()
public P2<StreetEdge> split(SplitterVertex splitterVertex, boolean destructive, boolean createSemiPermanentEdges)
SemiPermanentPartialStreetEdge.split
. The
original edge is still traversable in the graph.
3. A temporary split is used to link a StreetEdge to an origin or destination. In this case there is only a need
for creating outgoing edges from the origin and incoming edges to the destination.
// TODO: there is also something about half edges which may not be needed anymore?splitterVertex
- The new vertex that the newly split edge(s) will become connected to.destructive
- Whether or not the split should be permanent and result in the old edge no longer existing
within the graph.createSemiPermanentEdges
- Whether or not the split should result in the creation of semi-permanent edges
or temporary edges.public long getStartOsmNodeId()
public long getEndOsmNodeId()
public boolean addCarNetwork(String carNetwork)
public boolean containsCarNetwork(String carNetwork)
public boolean addVehicleNetwork(String vehicleNetwork)
public boolean containsVehicleNetwork(String vehicleNetwork)
Copyright © 2020. All rights reserved.