public class EdgeIntersection extends Object implements Comparable
The intersection may either be a single point, or a line segment (in which case this point is the start of the line segment) The intersection point must be precise.
Modifier and Type | Field and Description |
---|---|
Coordinate |
coord
Point of intersection
|
double |
dist
Edge distance of this point along the containing line segment
|
int |
segmentIndex
Index of the containing line segment in the parent edge
|
Constructor and Description |
---|
EdgeIntersection(Coordinate coord,
int segmentIndex,
double dist)
EdgeIntersection.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(int segmentIndex,
double dist)
Comparison with segment and distance.
|
int |
compareTo(Object obj) |
Coordinate |
getCoordinate() |
double |
getDistance() |
int |
getSegmentIndex() |
boolean |
isEndPoint(int maxSegmentIndex) |
void |
print(PrintStream out) |
String |
toString() |
public Coordinate coord
public int segmentIndex
public double dist
public EdgeIntersection(Coordinate coord, int segmentIndex, double dist)
coord
- Point of intersectionsegmentIndex
- Index of the containing line segment in the parent edgedist
- Edge distance of this point along the containing line segmentpublic Coordinate getCoordinate()
public int getSegmentIndex()
public double getDistance()
public int compareTo(Object obj)
compareTo
in interface Comparable
public int compare(int segmentIndex, double dist)
segmentIndex
- index of the containing line segmentdist
- dge distance of this point along the containing line segment1
this EdgeIntersection is located before the argument location,
0
this EdgeIntersection is at the argument location,
1
this EdgeIntersection is located after the argument locationpublic boolean isEndPoint(int maxSegmentIndex)
public void print(PrintStream out)
Copyright © 2022. All rights reserved.