Class BoundedOverlay

java.lang.Object
mil.nga.geopackage.map.tiles.overlay.BoundedOverlay
All Implemented Interfaces:
TileProvider
Direct Known Subclasses:
CompositeOverlay, FeatureOverlay, GeoPackageOverlay, XYZGeoPackageOverlay

public abstract class BoundedOverlay extends Object implements TileProvider
Abstract overlay which provides bounding returned tiles by zoom levels and/or a bounding box
Since:
1.2.5
  • Field Details

    • webMercatorBoundingBox

      protected BoundingBox webMercatorBoundingBox
      Web mercator bounding box
  • Constructor Details

    • BoundedOverlay

      public BoundedOverlay()
      Constructor
  • Method Details

    • getMinZoom

      public Integer getMinZoom()
      Get the min zoom
      Returns:
      min zoom
    • setMinZoom

      public void setMinZoom(Integer minZoom)
      Set the min zoom
      Parameters:
      minZoom - min zoom
    • getMaxZoom

      public Integer getMaxZoom()
      Get the max zoom
      Returns:
      max zoom
    • setMaxZoom

      public void setMaxZoom(Integer maxZoom)
      Set the max zoom
      Parameters:
      maxZoom - max zoom
    • setBoundingBox

      public void setBoundingBox(BoundingBox boundingBox, Projection projection)
      Set the bounding box, provided as the indicated projection
      Parameters:
      boundingBox - bounding box
      projection - projection
    • getWebMercatorBoundingBox

      public BoundingBox getWebMercatorBoundingBox()
      Get the web mercator bounding box
      Returns:
      bounding box
    • getBoundingBox

      public BoundingBox getBoundingBox(Projection projection)
      Get the bounding box as the provided projection
      Parameters:
      projection - projection
      Returns:
      bounding box
    • getWebMercatorBoundingBox

      protected BoundingBox getWebMercatorBoundingBox(BoundingBox requestWebMercatorBoundingBox)
      Get the bounded overlay web mercator bounding box expanded as needed by the requested bounding box dimensions
      Parameters:
      requestWebMercatorBoundingBox - requested web mercator bounding box
      Returns:
      web mercator bounding box
    • getTile

      public Tile getTile(int x, int y, int zoom)
      Specified by:
      getTile in interface TileProvider
    • hasTile

      public boolean hasTile(int x, int y, int zoom)
      Determine if there is a tile for the x, y, and zoom
      Parameters:
      x - x coordinate
      y - y coordinate
      zoom - zoom value
      Returns:
      true if there is a tile
      Since:
      1.2.6
    • hasTileToRetrieve

      protected abstract boolean hasTileToRetrieve(int x, int y, int zoom)
      Check if there is a tile to retrieve
      Parameters:
      x - x coordinate
      y - y coordinate
      zoom - zoom value
      Returns:
      true if there is a tile
    • retrieveTile

      protected abstract Tile retrieveTile(int x, int y, int zoom)
      Retrieve the tile
      Parameters:
      x - x coordinate
      y - y coordinate
      zoom - zoom value
      Returns:
      tile
    • isWithinBounds

      public boolean isWithinBounds(int x, int y, int zoom)
      Is the tile within the zoom and bounding box bounds
      Parameters:
      x - x coordinate
      y - y coordinate
      zoom - zoom value
      Returns:
      true if within bounds
    • isWithinZoom

      public boolean isWithinZoom(float zoom)
      Check if the zoom is within the overlay zoom range
      Parameters:
      zoom - zoom value
      Returns:
      true if within zoom
    • isWithinBoundingBox

      public boolean isWithinBoundingBox(int x, int y, int zoom)
      Check if the tile request is within the desired tile bounds
      Parameters:
      x - x coordinate
      y - y coordinate
      zoom - zoom value
      Returns:
      true if within bounds