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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CGAlgorithms
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val CLOCKWISE: Int

    A value that indicates an orientation of clockwise, or a right turn.

  5. val COLLINEAR: Int

    A value that indicates an orientation of collinear, or no turn (straight).

  6. val COUNTERCLOCKWISE: Int

    A value that indicates an orientation of counterclockwise, or a left turn.

  7. val LEFT: Int
  8. val RIGHT: Int
  9. val STRAIGHT: Int
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. 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

  13. 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)

  14. 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

  15. 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

  16. 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

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. 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)

  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. 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

  25. 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

  26. 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

  27. 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

  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. def orientationIndex(p1: Coordinate, p2: Coordinate, q: Coordinate): Int

    Returns the index of the direction of the point q relative to a vector specified by p1-p2.

    Returns the index of the direction of the point q relative to a vector specified by p1-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

  32. 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

  33. 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

  34. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped