object CGAlgorithms
Specifies and implements various fundamental Computational Geometric algorithms. The algorithms supplied in this class are robust for double-precision floating point.
- Deprecated
See Length, Area, Distance, Orientation, PointLocation
- Version
1.7
- Alphabetic
- By Inheritance
- CGAlgorithms
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val CLOCKWISE: Int
A value that indicates an orientation of clockwise, or a right turn.
- val COLLINEAR: Int
A value that indicates an orientation of collinear, or no turn (straight).
- val COUNTERCLOCKWISE: Int
A value that indicates an orientation of counterclockwise, or a left turn.
- val LEFT: Int
- val RIGHT: Int
- val STRAIGHT: Int
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def computeOrientation(p1: Coordinate, p2: Coordinate, q: Coordinate): Int
Computes the orientation of a point q to the directed line segment p1-p2.
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.
- p1
the first vertex of the line segment
- p2
the second vertex of the line segment
- q
the point to compute the relative orientation of return 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
- def distanceLineLine(A: Coordinate, B: Coordinate, C: Coordinate, D: Coordinate): Double
Computes the distance from a line segment AB to a line segment CD
Computes the distance from a line segment AB to a line segment CD
Note: NON-ROBUST!
- A
a point of one line
- B
the second point of (must be different to A)
- C
one point of the line
- D
another point of the line (must be different to A)
- def distancePointLine(p: Coordinate, line: Array[Coordinate]): Double
Computes the distance from a point to a sequence of line segments.
Computes the distance from a point to a sequence of line segments.
- p
a point
- line
a sequence of contiguous line segments defined by their vertices return the minimum distance between the point and the line segments
- def distancePointLine(p: Coordinate, A: Coordinate, B: Coordinate): Double
Computes the distance from a point p to a line segment AB
Computes the distance from a point p to a line segment AB
Note: NON-ROBUST!
- p
the point to compute the distance for
- A
one point of the line
- B
another point of the line (must be different to A) return the distance from p to line segment AB
- def distancePointLinePerpendicular(p: Coordinate, A: Coordinate, B: Coordinate): Double
Computes the perpendicular distance from a point p to the (infinite) line containing the points AB
Computes the perpendicular distance from a point p to the (infinite) line containing the points AB
- p
the point to compute the distance for
- A
one point of the line
- B
another point of the line (must be different to A) return the distance from p to line AB
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isCCW(ring: Array[Coordinate]): Boolean
Computes whether a ring defined by an array of {link Coordinate}s is oriented counter-clockwise.
Computes whether a ring defined by an array of {link Coordinate}s 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.
This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct.
- ring
an array of Coordinates forming a ring return true if the ring is oriented counter-clockwise. throws IllegalArgumentException if there are too few points to determine orientation (< 4)
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isOnLine(p: Coordinate, pt: Array[Coordinate]): Boolean
Tests whether a point lies on the line segments defined by a list of coordinates.
Tests whether a point lies on the line segments defined by a list of coordinates.
return true if the point is a vertex of the line or lies in the interior of a line segment in the linestring
- def isPointInRing(p: Coordinate, ring: Array[Coordinate]): Boolean
Tests whether a point lies inside or on a ring.
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.
- p
point to check for ring inclusion
- ring
an array of coordinates representing the ring (which must have first point identical to last point) return true if p is inside ring
- See also
locatePointInRing
- def length(pts: CoordinateSequence): Double
Computes the length of a linestring specified by a sequence of points.
Computes the length of a linestring specified by a sequence of points.
- pts
the points specifying the linestring return the length of the linestring
- def locatePointInRing(p: Coordinate, ring: Array[Coordinate]): Int
Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring.
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.
- p
point to check for ring inclusion
- ring
an array of coordinates representing the ring (which must have first point identical to last point) return the { @link Location} of p relative to the ring
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def orientationIndex(p1: Coordinate, p2: Coordinate, q: Coordinate): Int
Returns the index of the direction of the point
qrelative to a vector specified byp1-p2.Returns the index of the direction of the point
qrelative to a vector specified byp1-p2.- p1
the origin point of the vector
- p2
the final point of the vector
- q
the point to compute the direction to return 1 if q is counter-clockwise (left) from p1-p2 return -1 if q is clockwise (right) from p1-p2 return 0 if q is collinear with p1-p2
- def signedArea(ring: CoordinateSequence): Double
Computes the signed area for a ring.
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
- ring
the coordinates forming the ring return the signed area of the ring
- def signedArea(ring: Array[Coordinate]): Double
Computes the signed area for a ring.
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.
- ring
the coordinates forming the ring return the signed area of the ring
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()