Length
, Area
, Distance
,
Orientation
, PointLocation
public class CGAlgorithms extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CLOCKWISE
Deprecated.
Use
Orientation.CLOCKWISE instead. |
static int |
COLLINEAR
Deprecated.
Use
Orientation.COLLINEAR instead. |
static int |
COUNTERCLOCKWISE
Deprecated.
Use
Orientation.COUNTERCLOCKWISE instead. |
static int |
LEFT
Deprecated.
Use
Orientation.LEFT instead. |
static int |
RIGHT
Deprecated.
Use
Orientation.RIGHT instead. |
static int |
STRAIGHT
Deprecated.
Use
Orientation.STRAIGHT instead. |
Constructor and Description |
---|
CGAlgorithms()
Deprecated.
|
public static final int CLOCKWISE
Orientation.CLOCKWISE
instead.public static final int RIGHT
Orientation.RIGHT
instead.public static final int COUNTERCLOCKWISE
Orientation.COUNTERCLOCKWISE
instead.public static final int LEFT
Orientation.LEFT
instead.public static final int COLLINEAR
Orientation.COLLINEAR
instead.public static final int STRAIGHT
Orientation.STRAIGHT
instead.public static int orientationIndex(Coordinate p1, Coordinate p2, Coordinate q)
Orientation.index(Coordinate, Coordinate, Coordinate)
instead.q
relative to
a vector specified by p1-p2
.p1
- the origin point of the vectorp2
- the final point of the vectorq
- the point to compute the direction to1
if q is counter-clockwise (left) from p1-p2
-1
if q is clockwise (right) from p1-p2
0
if q is collinear with p1-p2public static boolean isPointInRing(Coordinate p, Coordinate[] ring)
PointLocation.isInRing(Coordinate, Coordinate[])
instead.This method does not first check the point against the envelope of the ring.
p
- point to check for ring inclusionring
- an array of coordinates representing the ring (which must have
first point identical to last point)locatePointInRing(Coordinate, Coordinate[])
public static int locatePointInRing(Coordinate p, Coordinate[] ring)
PointLocation.locateInRing(Coordinate, Coordinate[])
instead.This method does not first check the point against the envelope of the ring.
p
- point to check for ring inclusionring
- an array of coordinates representing the ring (which must have
first point identical to last point)Location
of p relative to the ringpublic static boolean isOnLine(Coordinate p, Coordinate[] pt)
PointLocation.isOnLine(Coordinate, Coordinate[])
instead.public static boolean isCCW(Coordinate[] ring)
Orientation.isCCW(Coordinate[])
instead.Coordinate
s is
oriented counter-clockwise.
ring
- an array of Coordinates forming a ringIllegalArgumentException
- if there are too few points to determine orientation (< 4)public static int computeOrientation(Coordinate p1, Coordinate p2, Coordinate q)
Orientation.index(Coordinate, Coordinate, Coordinate)
instead.p1
- the first vertex of the line segmentp2
- the second vertex of the line segmentq
- the point to compute the relative orientation ofpublic static double distancePointLine(Coordinate p, Coordinate A, Coordinate B)
Distance.pointToSegment(Coordinate, Coordinate, Coordinate)
instead.p
- the point to compute the distance forA
- one point of the lineB
- another point of the line (must be different to A)public static double distancePointLinePerpendicular(Coordinate p, Coordinate A, Coordinate B)
Distance.pointToLinePerpendicular(Coordinate, Coordinate, Coordinate)
instead.p
- the point to compute the distance forA
- one point of the lineB
- another point of the line (must be different to A)public static double distancePointLine(Coordinate p, Coordinate[] line)
Distance.pointToSegmentString(Coordinate, Coordinate[])
instead.p
- a pointline
- a sequence of contiguous line segments defined by their verticespublic static double distanceLineLine(Coordinate A, Coordinate B, Coordinate C, Coordinate D)
Distance.segmentToSegment(Coordinate, Coordinate, Coordinate, Coordinate)
instead.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)public static double signedArea(Coordinate[] ring)
Area.ofRing(Coordinate[])
or
Area.ofRingSigned(Coordinate[])
instead.ring
- the coordinates forming the ringpublic static double signedArea(CoordinateSequence ring)
Area.ofRing(CoordinateSequence)
or
Area.ofRingSigned(CoordinateSequence)
instead.ring
- the coordinates forming the ringpublic static double length(CoordinateSequence pts)
Length.ofLine(CoordinateSequence)
instead.pts
- the points specifying the linestringCopyright © 2022. All rights reserved.