Class Polygon


  • public class Polygon
    extends Object
    Author:
    Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), psmeros
    • Constructor Detail

      • Polygon

        public Polygon​(String name)
      • Polygon

        public Polygon​(Polygon polygon)
    • Method Detail

      • add

        public void add​(Point y)
        Adds a point to the polygon. Also updates the distance list
        Parameters:
        y - Point to add
      • remove

        public void remove​(Point y)
        removes a point from the polygon. Also updates the distance list
        Parameters:
        y - Point to remove
      • toString

        public String toString()
        String representation of the polygon
        Overrides:
        toString in class Object
        Returns:
        polygon, as a string
      • size

        public long size()
        Return the size of the polygon
        Returns:
        size, the number of points in the polygon
      • getGeometry

        public org.locationtech.jts.geom.Geometry getGeometry()
                                                       throws org.locationtech.jts.io.ParseException
        Returns a Geometry from the Points of the Polygon
        Returns:
        Geometry
        Throws:
        org.locationtech.jts.io.ParseException - if Geometry is not valid