Class Circle

  • All Implemented Interfaces:
    Shapeable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<org.locationtech.jts.geom.Coordinate>

    public class Circle
    extends org.locationtech.jts.geom.Coordinate
    implements Shapeable
    Adding a Polygon based Circle to the org.locationtech.jts suite.
    See Also:
    Geometry, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.locationtech.jts.geom.Coordinate

        org.locationtech.jts.geom.Coordinate.DimensionalComparator
    • Field Summary

      • Fields inherited from class org.locationtech.jts.geom.Coordinate

        M, NULL_ORDINATE, x, X, y, Y, z, Z
    • Constructor Summary

      Constructors 
      Constructor Description
      Circle​(org.locationtech.jts.geom.Coordinate coordinate, double radius)
      The constructor
      Circle​(org.locationtech.jts.geom.Coordinate coordinate, double radius, int numPoints)
      The constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(Circle circle)  
      Circle copy()
      Override the coordinate copy.
      boolean covers​(Circle circle)
      Test, whether the circle covers another circle.
      org.locationtech.jts.geom.Coordinate getCenter()
      Get central coordinate of circle.
      org.locationtech.jts.geom.Envelope getEnvelope()  
      int getNumPoints()  
      double getRadius()  
      boolean inside​(org.locationtech.jts.geom.Coordinate c)
      Tests whether a coordinate lays inside the circle or not.
      org.locationtech.jts.geom.Coordinate project​(org.locationtech.jts.geom.Coordinate c)
      Project a coordinate on the edge of the circle.
      org.locationtech.jts.geom.Polygon toPolygon()
      Generate a polygon from the circle.
      java.awt.Shape toShape​(AdvancedShapeWriter advancedShapeWriter)
      Shape the circle as an awt ellipse.
      java.lang.String toString()
      Custom string serialization.
      • Methods inherited from class org.locationtech.jts.geom.Coordinate

        clone, compareTo, distance, distance3D, equalInZ, equals, equals2D, equals2D, equals3D, getM, getOrdinate, getX, getY, getZ, hashCode, hashCode, setCoordinate, setM, setOrdinate, setX, setY, setZ
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Circle

        public Circle​(org.locationtech.jts.geom.Coordinate coordinate,
                      double radius,
                      int numPoints)
        The constructor
        Parameters:
        coordinate - the center point of the circle.
        radius - the radius of the circle.
        numPoints - the number of points, the circle get after converting to a Polygon.
      • Circle

        public Circle​(org.locationtech.jts.geom.Coordinate coordinate,
                      double radius)
        The constructor
        Parameters:
        coordinate - the center point of the circle.
        radius - the radius of the circle.
    • Method Detail

      • inside

        public boolean inside​(org.locationtech.jts.geom.Coordinate c)
        Tests whether a coordinate lays inside the circle or not.
        Parameters:
        c - coordinate to test
        Returns:
        whether a coordinate lays inside the circle or not
      • covers

        public boolean covers​(Circle circle)
        Test, whether the circle covers another circle.
        Parameters:
        circle - circle that may be covered.
        Returns:
        whether the circle covers another circle or not
      • project

        public org.locationtech.jts.geom.Coordinate project​(org.locationtech.jts.geom.Coordinate c)
        Project a coordinate on the edge of the circle.
        Parameters:
        c - coordinate to project
        Returns:
        projected coordinate, may be center if projected point is center
      • getCenter

        public org.locationtech.jts.geom.Coordinate getCenter()
        Get central coordinate of circle.
        Returns:
        central coordinate
      • toPolygon

        public org.locationtech.jts.geom.Polygon toPolygon()
        Generate a polygon from the circle.
        Returns:
        circular polygon
      • toShape

        public java.awt.Shape toShape​(AdvancedShapeWriter advancedShapeWriter)
        Shape the circle as an awt ellipse.
        Specified by:
        toShape in interface Shapeable
        Parameters:
        advancedShapeWriter - shape writer for shape transformation
        Returns:
        awt circle shape
      • toString

        public java.lang.String toString()
        Custom string serialization.
        Overrides:
        toString in class org.locationtech.jts.geom.Coordinate
        Returns:
        string representation for circle
      • copy

        public Circle copy()
        Override the coordinate copy.
        Overrides:
        copy in class org.locationtech.jts.geom.Coordinate
        Returns:
        copied circle
      • getEnvelope

        public org.locationtech.jts.geom.Envelope getEnvelope()
      • contains

        public boolean contains​(Circle circle)
        Parameters:
        circle - the Circle we want know test, whether it lies completely in this Circle
        Returns:
        true if this contains circle. false, otherwise
      • getRadius

        public double getRadius()
      • getNumPoints

        public int getNumPoints()