Class Polygon

All Implemented Interfaces:
Serializable

public class Polygon extends BasePolygon
See Also:
  • Constructor Details

    • Polygon

      public Polygon(int id, String polyName, Vertex[] verts)
    • Polygon

      public Polygon(int id, String polyName, Vertex[] verts, double minLat, double maxLat, double minLon, double maxLon)
  • Method Details

    • getPolyId

      public int getPolyId()
    • getName

      public String getName()
    • getMinLat

      public double getMinLat()
      Description copied from class: BasePolygon
      Gets the latitude of the most Southerly Vertex in the BasePolygon. For rapid selection of candidate points from the database, it is convenient to get the lat and lon extrema of the BasePolygon to form a query that returns all the points within the smallest box that encloses the BasePolygon.
      Overrides:
      getMinLat in class BasePolygon
      Returns:
      The minLat value
    • getMaxLat

      public double getMaxLat()
      Description copied from class: BasePolygon
      Gets the latitude of the most Northerly Vertex in the BasePolygon. For rapid selection of candidate points from the database, it is convenient to get the lat and lon extrema of the BasePolygon to form a query that returns all the points within the smallest box that encloses the BasePolygon.
      Overrides:
      getMaxLat in class BasePolygon
      Returns:
      The maxLat value
    • getMinLon

      public double getMinLon()
      Description copied from class: BasePolygon
      Gets the latitude of the most Westerly Vertex in the BasePolygon. For rapid selection of candidate points from the database, it is convenient to get the lat and lon extrema of the BasePolygon to form a query that returns all the points within the smallest box that encloses the BasePolygon.
      Overrides:
      getMinLon in class BasePolygon
      Returns:
      The minLon value
    • getMaxLon

      public double getMaxLon()
      Description copied from class: BasePolygon
      Gets the latitude of the most Easterly Vertex in the BasePolygon. For rapid selection of candidate points from the database, it is convenient to get the lat and lon extrema of the BasePolygon to form a query that returns all the points within the smallest box that encloses the BasePolygon.
      Overrides:
      getMaxLon in class BasePolygon
      Returns:
      The maxLon value
    • contains

      public boolean contains(double x, double y)
      Description copied from class: BasePolygon
      Determine whether a point (given as a lat and a lon is inside the BasePolygon. Uses a method by Sedgewick, "Algorithms in C"
      Overrides:
      contains in class BasePolygon
      Parameters:
      x - The latitude of the point to be tested
      y - The longitude of the point to be tested
      Returns:
      true if the point is inside the BasePolygon
    • contains

      public boolean contains(Vertex v)
      Description copied from class: BasePolygon
      Determine whether a point (given as a Vertex object) is inside the BasePolygon. Uses a method by Sedgewick, "Algorithms in C"
      Overrides:
      contains in class BasePolygon
      Parameters:
      v - The point to be tested
      Returns:
      true if the point is inside the BasePolygon
    • setPolyid

      public void setPolyid(int polyid)
      Parameters:
      polyid - the polyid to set