Class CGAlgorithms
java.lang.Object
org.locationtech.jts.algorithm.CGAlgorithms
Deprecated.
Specifies and implements various fundamental Computational Geometric
algorithms. The algorithms supplied in this class are robust for
double-precision floating point.
- Version:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.UseOrientation.CLOCKWISEinstead.static final intDeprecated.UseOrientation.COLLINEARinstead.static final intDeprecated.UseOrientation.COUNTERCLOCKWISEinstead.static final intDeprecated.UseOrientation.LEFTinstead.static final intDeprecated.UseOrientation.RIGHTinstead.static final intDeprecated.UseOrientation.STRAIGHTinstead. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomputeOrientation(Coordinate p1, Coordinate p2, Coordinate q) Deprecated.static doubledistanceLineLine(Coordinate A, Coordinate B, Coordinate C, Coordinate D) Deprecated.static doubledistancePointLine(Coordinate p, Coordinate[] line) Deprecated.static doubledistancePointLine(Coordinate p, Coordinate A, Coordinate B) Deprecated.static doubleDeprecated.static booleanisCCW(Coordinate[] ring) Deprecated.UseOrientation.isCCW(Coordinate[])instead.static booleanisOnLine(Coordinate p, Coordinate[] pt) Deprecated.UsePointLocation.isOnLine(Coordinate, Coordinate[])instead.static booleanisPointInRing(Coordinate p, Coordinate[] ring) Deprecated.UsePointLocation.isInRing(Coordinate, Coordinate[])instead.static doublelength(CoordinateSequence pts) Deprecated.UseLength.ofLine(CoordinateSequence)instead.static intlocatePointInRing(Coordinate p, Coordinate[] ring) Deprecated.UsePointLocation.locateInRing(Coordinate, Coordinate[])instead.static intorientationIndex(Coordinate p1, Coordinate p2, Coordinate q) Deprecated.static doublesignedArea(Coordinate[] ring) Deprecated.UseArea.ofRing(Coordinate[])orArea.ofRingSigned(Coordinate[])instead.static doublesignedArea(CoordinateSequence ring) Deprecated.UseArea.ofRing(CoordinateSequence)orArea.ofRingSigned(CoordinateSequence)instead.
-
Field Details
-
CLOCKWISE
public static final int CLOCKWISEDeprecated.UseOrientation.CLOCKWISEinstead.A value that indicates an orientation of clockwise, or a right turn.- See Also:
-
RIGHT
public static final int RIGHTDeprecated.UseOrientation.RIGHTinstead.A value that indicates an orientation of clockwise, or a right turn.- See Also:
-
COUNTERCLOCKWISE
public static final int COUNTERCLOCKWISEDeprecated.UseOrientation.COUNTERCLOCKWISEinstead.A value that indicates an orientation of counterclockwise, or a left turn.- See Also:
-
LEFT
public static final int LEFTDeprecated.UseOrientation.LEFTinstead.A value that indicates an orientation of counterclockwise, or a left turn.- See Also:
-
COLLINEAR
public static final int COLLINEARDeprecated.UseOrientation.COLLINEARinstead.A value that indicates an orientation of collinear, or no turn (straight).- See Also:
-
STRAIGHT
public static final int STRAIGHTDeprecated.UseOrientation.STRAIGHTinstead.A value that indicates an orientation of collinear, or no turn (straight).- See Also:
-
-
Constructor Details
-
CGAlgorithms
public CGAlgorithms()Deprecated.
-
-
Method Details
-
orientationIndex
Deprecated.Returns the index of the direction of the pointqrelative to a vector specified byp1-p2.- Parameters:
p1- the origin point of the vectorp2- the final point of the vectorq- the point to compute the direction to- Returns:
1if q is counter-clockwise (left) from p1-p2-1if q is clockwise (right) from p1-p20if q is collinear with p1-p2
-
isPointInRing
Deprecated.UsePointLocation.isInRing(Coordinate, Coordinate[])instead.Tests whether a point lies inside or on a ring. The ring may be oriented in either direction. A point lying exactly on the ring boundary is considered to be inside the ring.This method does not first check the point against the envelope of the ring.
- Parameters:
p- point to check for ring inclusionring- an array of coordinates representing the ring (which must have first point identical to last point)- Returns:
- true if p is inside ring
- See Also:
-
locatePointInRing
Deprecated.UsePointLocation.locateInRing(Coordinate, Coordinate[])instead.Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. The ring may be oriented in either direction.This method does not first check the point against the envelope of the ring.
- Parameters:
p- point to check for ring inclusionring- an array of coordinates representing the ring (which must have first point identical to last point)- Returns:
- the
Locationof p relative to the ring
-
isOnLine
Deprecated.UsePointLocation.isOnLine(Coordinate, Coordinate[])instead.Tests whether a point lies on the line segments defined by a list of coordinates.- Returns:
- true if the point is a vertex of the line or lies in the interior of a line segment in the linestring
-
isCCW
Deprecated.UseOrientation.isCCW(Coordinate[])instead.Computes whether a ring defined by an array ofCoordinates is oriented counter-clockwise.- The list of points is assumed to have the first and last points equal.
- This will handle coordinate lists which contain repeated points.
- Parameters:
ring- an array of Coordinates forming a ring- Returns:
- true if the ring is oriented counter-clockwise.
- Throws:
IllegalArgumentException- if there are too few points to determine orientation (< 4)
-
computeOrientation
Deprecated.Computes the orientation of a point q to the directed line segment p1-p2. The orientation of a point relative to a directed line segment indicates which way you turn to get to q after travelling from p1 to p2.- Parameters:
p1- the first vertex of the line segmentp2- the second vertex of the line segmentq- the point to compute the relative orientation of- Returns:
- 1 if q is counter-clockwise from p1-p2, or -1 if q is clockwise from p1-p2, or 0 if q is collinear with p1-p2
-
distancePointLine
Deprecated.Computes the distance from a point p to a line segment AB Note: NON-ROBUST!- Parameters:
p- the point to compute the distance forA- one point of the lineB- another point of the line (must be different to A)- Returns:
- the distance from p to line segment AB
-
distancePointLinePerpendicular
Deprecated.Computes the perpendicular distance from a point p to the (infinite) line containing the points AB- Parameters:
p- the point to compute the distance forA- one point of the lineB- another point of the line (must be different to A)- Returns:
- the distance from p to line AB
-
distancePointLine
Deprecated.Computes the distance from a point to a sequence of line segments.- Parameters:
p- a pointline- a sequence of contiguous line segments defined by their vertices- Returns:
- the minimum distance between the point and the line segments
-
distanceLineLine
Deprecated.Computes the distance from a line segment AB to a line segment CD Note: NON-ROBUST!- Parameters:
A- a point of one lineB- the second point of (must be different to A)C- one point of the lineD- another point of the line (must be different to A)
-
signedArea
Deprecated.UseArea.ofRing(Coordinate[])orArea.ofRingSigned(Coordinate[])instead.Computes the signed area for a ring. The signed area is positive if the ring is oriented CW, negative if the ring is oriented CCW, and zero if the ring is degenerate or flat.- Parameters:
ring- the coordinates forming the ring- Returns:
- the signed area of the ring
-
signedArea
Deprecated.UseArea.ofRing(CoordinateSequence)orArea.ofRingSigned(CoordinateSequence)instead.Computes the signed area for a ring. The signed area is:- positive if the ring is oriented CW
- negative if the ring is oriented CCW
- zero if the ring is degenerate or flat
- Parameters:
ring- the coordinates forming the ring- Returns:
- the signed area of the ring
-
length
Deprecated.UseLength.ofLine(CoordinateSequence)instead.Computes the length of a linestring specified by a sequence of points.- Parameters:
pts- the points specifying the linestring- Returns:
- the length of the linestring
-
Length,Area,Distance,Orientation,PointLocation