java.lang.Object
org.openstreetmap.josm.data.imagery.Shape

public class Shape extends Object
Data class to store the outline for background imagery coverage. Configuration data for imagery to describe the coverage area (ImageryInfo.ImageryBounds).
  • Field Details

  • Constructor Details

    • Shape

      public Shape(String asString, String separator)
    • Shape

      public Shape()
      Constructs a new empty Shape.
  • Method Details

    • encodeAsString

      public String encodeAsString(String separator)
      Encodes this as a string so that it may be parsed using Shape(String, String)
      Parameters:
      separator - The separator
      Returns:
      The string encoded shape
    • encodeAsString

      public static String encodeAsString(List<Shape> shapes)
      Encodes the shapes as a string using , and ; as separators
      Parameters:
      shapes - The shapes to encode
      Returns:
      The string encoded shapes
    • getPoints

      public List<org.openstreetmap.gui.jmapviewer.Coordinate> getPoints()
    • contains

      public boolean contains(LatLon latlon)
      Check if the coordinates are inside this shape.
      Parameters:
      latlon - The latlon to look for
      Returns:
      true if the LatLon is inside the shape.
      See Also:
    • addPoint

      public void addPoint(String sLat, String sLon)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashPolygon

      private static int hashPolygon(Polygon coords)
      Hash a polygon
      Parameters:
      coords - The polygon to hash
      Returns:
      The hashcode to use; equivalent to Object.hashCode(), but zero allocations.
    • equalsPolygon

      private static boolean equalsPolygon(Polygon first, Polygon second)
      Check that two Polygons are equal
      Parameters:
      first - The first polygon to check
      second - The second polygon to check
      Returns:
      true if the polygons are equal