Class PathGuideItem
- java.lang.Object
-
- com.supermap.analyst.networkanalyst.PathGuideItem
-
public class PathGuideItem extends java.lang.Object
The path guide item class.The path guide (
PathGuide
) records how to travel from the start point to the destination step by step, in which each key feature is corresponding with a subitem of the path guide. These key features include the stops (the imported points by users that are used in the analysis can be common points or nodes), the passed edges and network nodes. This class can be used to set the path guide item, including the ID, name, index, weight, etc. Also, this class can help determine whether the item is a point or edge and return the direction, turn type, etc.In transportation analyst, the path table subkey can be the following categories:
- Stop: The analysis point to be used. Such as the points used in optimal path analysis.
Line Segment: When the stop is a common coordinate point, you should add the stop to the network. And then you can analyze based on the network. Please refer to the
setTolerance
method.As shown below, the red dotted line is the shortest distance from the stop to network. Note: when the stop is near the edge of the network segment. as shown below. This distance refers to the distance between stops and endpoints.
- The point corresponding to the stop: The point is the corresponding point when adding the stop to the network.
- Road Section: A section road when driving. In transportation analysis, we use arcs to simulate the road, so the road sections are in the arcs. Note: Multiple arcs may merger into a path guide item when the names of arcs are same, and the corner between adjacent arcs is less than 30 degrees.
- Turning Point: The crossing between two adjacent sections . The crossing means the actual road crossing (crossroads or T-junction) that is likely to change the direction. As shown above, the 2783, 2786 and 2691 are all turning point. The turning point must be a network node.
You can determine which styles the path guide items are through the returned value of PathGuideItem. The following table summarizes the comparison table of the return values, which is easy for users to understand and use.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Rectangle2D
getBounds()
Returns the range of this path guide item.DirectionType
getDirectionType()
Returns the direction of the path guide item.double
getDistance()
Returns the distance from a stop to the network, and it is supported only when the path table item is the stop.GeoLine
getGuideLine()
Returns the corresponding path guide segment when the item is line ( is true).int
getID()
Returns the ID of the path guide item.int
getIndex()
Returns the number of the path guide item.double
getLength()
Returns the corresponding line length when the path guide item is line (namely theisEdge
is true).java.lang.String
getName()
Returns the name of path guide item.SideType
getSideType()
Returns whether the stop is left side, right side or on the road when this path guide item is stop.double
getTurnAngle()
Returns the next turning angle in the point when the path guide subitem is the point (isEdge
is false).TurnType
getTurnType()
When the path guide item is returned to the point (isEdge
is false), get the nest turning direction of the point.double
getWeight()
Returns the weight of a path guide sub item, i.e., the cost of the path guide subitem.boolean
isEdge()
Returns whether the path guide item is a line or point.boolean
isStop()
Returns whether the path guide item is a stop, or the corresponding point added to the network.
-
-
-
Method Detail
-
getID
public int getID()
Returns the ID of the path guide item.Excepts the following three situations, this method returns -1:
- When the path guide item is the stop of node mode, and the stop is node, return the node ID of this node;
- When the path guide item is the turning point, and the turning point is node, return the node ID of the node.
- When the path guide item is the road segment, return arc ID corresponding to the segment. If the road segment is combined by multiple arcs, return the arc ID of first segment.
Please see
PathGuideItem
for information about the path guide item.- Returns:
- The ID of the path guide item.
-
getIndex
public int getIndex()
Returns the number of the path guide item.Excepts the following two situations, this method returns -1:
- When the path guide item is a stop, this value is the sequence numbers in all stops, and it starts with 1. For example, if a stop is the second stop passed by the path, the Index of this stop is 2:
- When the path guide item is the tunning point, this value is the crossing number from this point to last turning point.
Please see
PathGuideItem
for information about the path guide item.- Returns:
- The index of the path guide item.
-
getName
public java.lang.String getName()
Returns the name of path guide item.Excepts the following two situations, this method returns null string:
- When the path guide item is stop or turning point, this value is specified according to the node name field (
setNodeNameField
) in transportation analyst. Or it is the null string. - When the path guide item is road or the line from stop to network, this value is specified according to the node name field (
setEdgeNameField
) in transportation analyst. Or it is the null string.
Please see
PathGuideItem
for information about the path guide item.- Returns:
- The name of the travel guide child.
- When the path guide item is stop or turning point, this value is specified according to the node name field (
-
isEdge
public boolean isEdge()
Returns whether the path guide item is a line or point. If it is true, representing the line, such as the road segment, line and so on. If it is false, representing the point.Please see
PathGuideItem
for information about the path guide item.- Returns:
- A boolean indicates whether the path guide item is a line or a point. True means the line; otherwise, false.
-
isStop
public boolean isStop()
Returns whether the path guide item is a stop, or the corresponding point added to the network.When
isStop
is true, the corresponding path guide item may be stop. Or when the stop is the coordinate point, it is the corresponding point in the network. Please refer toPathGuideItem
for more information.- Returns:
- A boolean indicates whther the path guide subitem is the site or the corresponding point in the site. true means yes; otherwise, false.
-
getWeight
public double getWeight()
Returns the weight of a path guide sub item, i.e., the cost of the path guide subitem. It has the same unit with the weight field of theWeightFieldInfo
object specified by theWeightFieldInfo
property of theWeightFieldInfo
object.When the path guide item is stop of road, turning point node, the cost is meaningful. Or it is 0.0.
- When path guide item is the road section, get the corresponding cost according to the arc and turn weights. If the turn table isn't set, the weight is 0;
- When the path guide item is the turning point or the stop, it is the corresponding turn weight. If the turn table isn't set, it is 0.0.
Please see
PathGuideItem
for information about the path guide item.- Returns:
- The weight of the path guide item.
-
getLength
public double getLength()
Returns the corresponding line length when the path guide item is line (namely theisEdge
is true). The unit is the same as the unit used in network dataset.Length is valid only if
isEdge
is true. Or it is 0.0.Please see
PathGuideItem
for information about the path guide item.- Returns:
- The length of the path guide item.
-
getTurnAngle
public double getTurnAngle()
Returns the next turning angle in the point when the path guide subitem is the point (isEdge
is false). The unit is in degrees and accurate to 0.1 degree. WhenisEdge
returns true, this method returns -1.Please see
PathGuideItem
for information about the path guide item.- Returns:
- The turning angle of the path guide subitem.
-
getDistance
public double getDistance()
Returns the distance from a stop to the network, and it is supported only when the path table item is the stop. The unit is the same as the network dataset used to analyze.A stop can not be on a network (neither on a edge nor on a node). You should add it to the network to analyze. This distance is the distance between the stop and the nearest edge. In the figure below, the orange points are the network nodes, the blue ones are the edges, the gray ones are the stops and the red line segments are the distances.
When the path guide item is other types, this value is 0.0.
Please see
PathGuideItem
for information about the path guide item.- Returns:
- The distance between stop and grid.
-
getBounds
public Rectangle2D getBounds()
Returns the range of this path guide item. If this item is line (isEdge
is true), it is the enclosing rectangle. If this item is point (isEdge
is false), it is the point itself.Please see
PathGuideItem
for information about the path guide item.- Returns:
- The range of the path guide item.
-
getDirectionType
public DirectionType getDirectionType()
Returns the direction of the path guide item. It is valid only when the path guide item is line (isEdge
is true). They can be east, south, west, north.When
isEdge
is false, theNONE
method returns , no direction.Please see
PathGuideItem
for information about the path guide item.- Returns:
- The direction of the path guide subitem.
-
getTurnType
public TurnType getTurnType()
When the path guide item is returned to the point (isEdge
is false), get the nest turning direction of the point.When
isEdge
returns true, this method returnsNONE
.Please see
PathGuideItem
for information about the path guide item.- Returns:
- The turning of the path guide subitem.
-
getSideType
public SideType getSideType()
Returns whether the stop is left side, right side or on the road when this path guide item is stop.When the path guide item is other types except the stop, this
NONE
method returns.Please see
PathGuideItem
for information about the path guide item.- Returns:
- The site is on which side of the road.
-
getGuideLine
public GeoLine getGuideLine()
Returns the corresponding path guide segment when the item is line ( is true).When returns false, this method returns null.
Please see
PathGuideItem
for information about the path guide item.- Returns:
- The path guide lines.
-
-