Class TileBoundingBoxUtils


  • public class TileBoundingBoxUtils
    extends Object
    Tile Bounding Box utility methods
    Author:
    osbornb
    • Constructor Detail

      • TileBoundingBoxUtils

        public TileBoundingBoxUtils()
    • Method Detail

      • overlap

        public static BoundingBox overlap​(BoundingBox boundingBox,
                                          BoundingBox boundingBox2)
        Get the overlapping bounding box between the two bounding boxes
        Parameters:
        boundingBox - bounding box 1
        boundingBox2 - bounding box 2
        Returns:
        bounding box
      • overlap

        public static BoundingBox overlap​(BoundingBox boundingBox,
                                          BoundingBox boundingBox2,
                                          boolean allowEmpty)
        Get the overlapping bounding box between the two bounding boxes
        Parameters:
        boundingBox - bounding box
        boundingBox2 - bounding box 2
        allowEmpty - allow empty latitude and/or longitude ranges when determining overlap
        Returns:
        bounding box
        Since:
        2.0.0
      • overlap

        public static BoundingBox overlap​(BoundingBox boundingBox,
                                          BoundingBox boundingBox2,
                                          double maxLongitude)
        Get the overlapping bounding box between the two bounding boxes adjusting the second box to an Anti-Meridian complementary version based upon the max longitude
        Parameters:
        boundingBox - bounding box
        boundingBox2 - bounding box 2
        maxLongitude - max longitude of the world for the current bounding box units
        Returns:
        bounding box
        Since:
        2.0.0
      • overlap

        public static BoundingBox overlap​(BoundingBox boundingBox,
                                          BoundingBox boundingBox2,
                                          double maxLongitude,
                                          boolean allowEmpty)
        Get the overlapping bounding box between the two bounding boxes adjusting the second box to an Anti-Meridian complementary version based upon the max longitude
        Parameters:
        boundingBox - bounding box
        boundingBox2 - bounding box 2
        maxLongitude - max longitude of the world for the current bounding box units
        allowEmpty - allow empty latitude and/or longitude ranges when determining overlap
        Returns:
        bounding box
        Since:
        2.0.0
      • isPointInBoundingBox

        public static boolean isPointInBoundingBox​(Point point,
                                                   BoundingBox boundingBox)
        Determine if the point is within the bounding box
        Parameters:
        point - bounding box
        boundingBox - bounding box
        Returns:
        true if within the bounding box
        Since:
        2.0.0
      • isPointInBoundingBox

        public static boolean isPointInBoundingBox​(Point point,
                                                   BoundingBox boundingBox,
                                                   double maxLongitude)
        Determine if the point is within the bounding box
        Parameters:
        point - bounding box
        boundingBox - bounding box
        maxLongitude - max longitude of the world for the current bounding box units
        Returns:
        true if within the bounding box
        Since:
        2.0.0
      • union

        public static BoundingBox union​(BoundingBox boundingBox,
                                        BoundingBox boundingBox2)
        Get the union bounding box combining the two bounding boxes
        Parameters:
        boundingBox - bounding box 1
        boundingBox2 - bounding box 2
        Returns:
        bounding box
      • getXPixel

        public static float getXPixel​(long width,
                                      BoundingBox boundingBox,
                                      double longitude)
        Get the X pixel for where the longitude fits into the bounding box
        Parameters:
        width - width
        boundingBox - bounding box
        longitude - longitude
        Returns:
        x pixel
      • getLongitudeFromPixel

        public static double getLongitudeFromPixel​(long width,
                                                   BoundingBox boundingBox,
                                                   float pixel)
        Get the longitude from the pixel location, bounding box, and image width
        Parameters:
        width - width
        boundingBox - bounding box
        pixel - pixel
        Returns:
        longitude
      • getLongitudeFromPixel

        public static double getLongitudeFromPixel​(long width,
                                                   BoundingBox boundingBox,
                                                   BoundingBox tileBoundingBox,
                                                   float pixel)
        Get the longitude from the pixel location, bounding box, tile bounding box (when different from bounding box), and image width
        Parameters:
        width - width
        boundingBox - bounding box
        tileBoundingBox - tile bounding box
        pixel - pixel
        Returns:
        longitude
        Since:
        3.2.0
      • getYPixel

        public static float getYPixel​(long height,
                                      BoundingBox boundingBox,
                                      double latitude)
        Get the Y pixel for where the latitude fits into the bounding box
        Parameters:
        height - height
        boundingBox - bounding box
        latitude - latitude
        Returns:
        y pixel
      • getLatitudeFromPixel

        public static double getLatitudeFromPixel​(long height,
                                                  BoundingBox boundingBox,
                                                  float pixel)
        Get the latitude from the pixel location, bounding box, and image height
        Parameters:
        height - height
        boundingBox - bounding box
        pixel - pixel
        Returns:
        latitude
      • getLatitudeFromPixel

        public static double getLatitudeFromPixel​(long height,
                                                  BoundingBox boundingBox,
                                                  BoundingBox tileBoundingBox,
                                                  float pixel)
        Get the latitude from the pixel location, bounding box, tile bounding box (when different from bounding box), and image height
        Parameters:
        height - height
        boundingBox - bounding box
        tileBoundingBox - tile bounding box
        pixel - pixel
        Returns:
        latitude
        Since:
        3.2.0
      • getBoundingBox

        public static BoundingBox getBoundingBox​(int x,
                                                 int y,
                                                 long zoom)
        Get the tile bounding box from the XYZ tile coordinates and zoom level
        Parameters:
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
      • getWebMercatorBoundingBox

        public static BoundingBox getWebMercatorBoundingBox​(long x,
                                                            long y,
                                                            long zoom)
        Get the Web Mercator tile bounding box from the XYZ tile coordinates and zoom level
        Parameters:
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
      • getWebMercatorBoundingBox

        public static BoundingBox getWebMercatorBoundingBox​(TileGrid tileGrid,
                                                            long zoom)
        Get the Web Mercator tile bounding box from the XYZ tile grid and zoom level
        Parameters:
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
      • getProjectedBoundingBox

        public static BoundingBox getProjectedBoundingBox​(Long projectionEpsg,
                                                          int x,
                                                          int y,
                                                          long zoom)
        Get the Projected tile bounding box from the XYZ tile coordinates and zoom level
        Parameters:
        projectionEpsg - projection epsg
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
      • getProjectedBoundingBox

        public static BoundingBox getProjectedBoundingBox​(String authority,
                                                          Long code,
                                                          int x,
                                                          int y,
                                                          long zoom)
        Get the Projected tile bounding box from the XYZ tile coordinates and zoom level
        Parameters:
        authority - projection authority
        code - projection code
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
        Since:
        1.3.0
      • getProjectedBoundingBox

        public static BoundingBox getProjectedBoundingBox​(Projection projection,
                                                          long x,
                                                          long y,
                                                          long zoom)
        Get the Projected tile bounding box from the XYZ tile coordinates and zoom level
        Parameters:
        projection - projection
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
      • getProjectedBoundingBox

        public static BoundingBox getProjectedBoundingBox​(Long projectionEpsg,
                                                          TileGrid tileGrid,
                                                          long zoom)
        Get the Projected tile bounding box from the XYZ tile tileGrid and zoom level
        Parameters:
        projectionEpsg - projection epsg
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
      • getProjectedBoundingBox

        public static BoundingBox getProjectedBoundingBox​(String authority,
                                                          Long code,
                                                          TileGrid tileGrid,
                                                          long zoom)
        Get the Projected tile bounding box from the XYZ tile tileGrid and zoom level
        Parameters:
        authority - projection authority
        code - projection code
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
        Since:
        1.3.0
      • getProjectedBoundingBox

        public static BoundingBox getProjectedBoundingBox​(Projection projection,
                                                          TileGrid tileGrid,
                                                          long zoom)
        Get the Projected tile bounding box from the XYZ tile grid and zoom level
        Parameters:
        projection - projection
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
      • getBoundingBoxAsWGS84

        public static BoundingBox getBoundingBoxAsWGS84​(TileGrid tileGrid,
                                                        long zoom)
        Get the WGS84 tile bounding box from the XYZ tile tileGrid and zoom level
        Parameters:
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.2.0
      • getProjectedBoundingBoxFromWGS84

        public static BoundingBox getProjectedBoundingBoxFromWGS84​(Long projectionEpsg,
                                                                   int x,
                                                                   int y,
                                                                   long zoom)
        Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level
        Parameters:
        projectionEpsg - projection epsg
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.0.1
      • getProjectedBoundingBoxFromWGS84

        public static BoundingBox getProjectedBoundingBoxFromWGS84​(String authority,
                                                                   Long code,
                                                                   int x,
                                                                   int y,
                                                                   long zoom)
        Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level
        Parameters:
        authority - projection authority
        code - projection code
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.0.1
      • getProjectedBoundingBoxFromWGS84

        public static BoundingBox getProjectedBoundingBoxFromWGS84​(Projection projection,
                                                                   long x,
                                                                   long y,
                                                                   long zoom)
        Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level
        Parameters:
        projection - projection
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.0.1
      • getProjectedBoundingBoxFromWGS84

        public static BoundingBox getProjectedBoundingBoxFromWGS84​(Long projectionEpsg,
                                                                   TileGrid tileGrid,
                                                                   long zoom)
        Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom level
        Parameters:
        projectionEpsg - projection epsg
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.0.1
      • getProjectedBoundingBoxFromWGS84

        public static BoundingBox getProjectedBoundingBoxFromWGS84​(String authority,
                                                                   Long code,
                                                                   TileGrid tileGrid,
                                                                   long zoom)
        Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom level
        Parameters:
        authority - projection authority
        code - projection code
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.0.1
      • getProjectedBoundingBoxFromWGS84

        public static BoundingBox getProjectedBoundingBoxFromWGS84​(Projection projection,
                                                                   TileGrid tileGrid,
                                                                   long zoom)
        Get the Projected tile bounding box from the WGS84 XYZ tile grid and zoom level
        Parameters:
        projection - projection
        tileGrid - tile grid
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.0.1
      • getTileGridFromWGS84

        public static TileGrid getTileGridFromWGS84​(Point point,
                                                    long zoom)
        Get the tile grid for the location specified as WGS84
        Parameters:
        point - point
        zoom - zoom level
        Returns:
        tile grid
        Since:
        1.1.0
      • getTileGrid

        public static TileGrid getTileGrid​(Point point,
                                           long zoom,
                                           Projection projection)
        Get the tile grid for the location specified as the projection
        Parameters:
        point - point
        zoom - zoom level
        projection - projection
        Returns:
        tile grid
        Since:
        1.1.0
      • getTileGridFromWebMercator

        public static TileGrid getTileGridFromWebMercator​(Point point,
                                                          long zoom)
        Get the tile grid for the location specified as web mercator
        Parameters:
        point - point
        zoom - zoom level
        Returns:
        tile grid
        Since:
        6.2.0
      • getTileGrid

        public static TileGrid getTileGrid​(BoundingBox webMercatorBoundingBox,
                                           long zoom)
        Get the tile grid that includes the entire tile bounding box
        Parameters:
        webMercatorBoundingBox - web mercator bounding box
        zoom - zoom level
        Returns:
        tile grid
      • getTileBounds

        public static BoundingBox getTileBounds​(Projection projection,
                                                Point point,
                                                int zoom)
        Get the bounds of the XYZ tile at the point and zoom level
        Parameters:
        projection - point and bounding box projection
        point - point location
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.2.0
      • getTileBoundsForWGS84

        public static BoundingBox getTileBoundsForWGS84​(Point point,
                                                        int zoom)
        Get the WGS84 bounds of the XYZ tile at the WGS84 point and zoom level
        Parameters:
        point - WGS84 point
        zoom - zoom level
        Returns:
        WGS84 bounding box
        Since:
        6.2.0
      • getTileBoundsForWebMercator

        public static BoundingBox getTileBoundsForWebMercator​(Point point,
                                                              int zoom)
        Get the web mercator bounds of the XYZ tile at the web mercator point and zoom level
        Parameters:
        point - web mercator point
        zoom - zoom level
        Returns:
        web mercator bounding box
        Since:
        6.2.0
      • getWGS84TileBounds

        public static BoundingBox getWGS84TileBounds​(Projection projection,
                                                     Point point,
                                                     int zoom)
        Get the bounds of the WGS84 tile at the point and zoom level
        Parameters:
        projection - point and bounding box projection
        point - point location
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.2.0
      • getWGS84TileBoundsForWGS84

        public static BoundingBox getWGS84TileBoundsForWGS84​(Point point,
                                                             int zoom)
        Get the WGS84 bounds of the WGS84 tile at the WGS84 point and zoom level
        Parameters:
        point - WGS84 point
        zoom - zoom level
        Returns:
        WGS84 bounding box
        Since:
        6.2.0
      • getWGS84TileBoundsForWebMercator

        public static BoundingBox getWGS84TileBoundsForWebMercator​(Point point,
                                                                   int zoom)
        Get the web mercator bounds of the WGS84 tile at the web mercator point and zoom level
        Parameters:
        point - web mercator point
        zoom - zoom level
        Returns:
        web mercator bounding box
        Since:
        6.2.0
      • toWebMercator

        public static BoundingBox toWebMercator​(BoundingBox boundingBox)
        Convert the bounding box coordinates to a new web mercator bounding box
        Parameters:
        boundingBox - bounding box
        Returns:
        bounding box
      • tileSize

        public static double tileSize​(int tilesPerSide)
        Get the tile size in meters
        Parameters:
        tilesPerSide - tiles per side
        Returns:
        tile size
      • zoomLevelOfTileSize

        public static double zoomLevelOfTileSize​(double tileSize)
        Get the zoom level from the tile size in meters
        Parameters:
        tileSize - tile size in meters
        Returns:
        zoom level
        Since:
        1.2.0
      • tileSize

        public static double tileSize​(int tilesPerSide,
                                      double totalLength)
        Get the tile size in length units
        Parameters:
        tilesPerSide - tiles per side
        totalLength - total length
        Returns:
        tile size
        Since:
        6.2.0
      • zoomLevelOfTileSize

        public static double zoomLevelOfTileSize​(double tileSize,
                                                 double totalLength)
        Get the zoom level from the tile size in length units
        Parameters:
        tileSize - tile size in units
        totalLength - total length
        Returns:
        zoom level
        Since:
        6.2.0
      • tileSizeWithZoom

        public static double tileSizeWithZoom​(long zoom,
                                              double totalLength)
        Get the tile size in length units at the zoom level
        Parameters:
        zoom - zoom level
        totalLength - total length
        Returns:
        tile size in units
        Since:
        6.2.0
      • tileWidthDegrees

        public static double tileWidthDegrees​(int tilesPerSide)
        Get the tile width in degrees
        Parameters:
        tilesPerSide - tiles per side
        Returns:
        tile width degrees
      • tileHeightDegrees

        public static double tileHeightDegrees​(int tilesPerSide)
        Get the tile height in degrees
        Parameters:
        tilesPerSide - tiles per side
        Returns:
        tile height degrees
      • tilesPerSide

        public static int tilesPerSide​(long zoom)
        Get the tiles per side, width and height, at the zoom level
        Parameters:
        zoom - zoom level
        Returns:
        tiles per side
      • tileSizeWithZoom

        public static double tileSizeWithZoom​(long zoom)
        Get the tile size in meters at the zoom level
        Parameters:
        zoom - zoom level
        Returns:
        tile size in meters
        Since:
        2.0.0
      • toleranceDistance

        public static double toleranceDistance​(long zoom,
                                               int pixels)
        Get the tolerance distance in meters for the zoom level and pixels length
        Parameters:
        zoom - zoom level
        pixels - pixel length
        Returns:
        tolerance distance in meters
        Since:
        2.0.0
      • toleranceDistance

        public static double toleranceDistance​(long zoom,
                                               int pixelWidth,
                                               int pixelHeight)
        Get the tolerance distance in meters for the zoom level and pixels length
        Parameters:
        zoom - zoom level
        pixelWidth - pixel width
        pixelHeight - pixel height
        Returns:
        tolerance distance in meters
        Since:
        2.0.0
      • getYAsOppositeTileFormat

        public static int getYAsOppositeTileFormat​(long zoom,
                                                   int y)
        Get the standard y tile location as TMS or a TMS y location as standard
        Parameters:
        zoom - zoom level
        y - y coordinate
        Returns:
        opposite tile format y
      • zoomFromTilesPerSide

        public static int zoomFromTilesPerSide​(int tilesPerSide)
        Get the zoom level from the tiles per side
        Parameters:
        tilesPerSide - tiles per side
        Returns:
        zoom level
      • getTileGrid

        public static TileGrid getTileGrid​(BoundingBox totalBox,
                                           long matrixWidth,
                                           long matrixHeight,
                                           BoundingBox boundingBox)
        Get the tile grid
        Parameters:
        totalBox - total bounding box
        matrixWidth - matrix width
        matrixHeight - matrix height
        boundingBox - bounding box
        Returns:
        tile grid
      • getTileColumn

        public static long getTileColumn​(BoundingBox totalBox,
                                         long matrixWidth,
                                         double longitude)
        Get the tile column of the longitude in constant units
        Parameters:
        totalBox - total bounding box
        matrixWidth - matrix width
        longitude - in constant units
        Returns:
        tile column if in the range, -1 if before, TileMatrix.getMatrixWidth() if after
      • getTileRow

        public static long getTileRow​(BoundingBox totalBox,
                                      long matrixHeight,
                                      double latitude)
        Get the tile row of the latitude in constant units
        Parameters:
        totalBox - total bounding box
        matrixHeight - matrix height
        latitude - in constant units
        Returns:
        tile row if in the range, -1 if before, TileMatrix.getMatrixHeight() if after
      • getBoundingBox

        public static BoundingBox getBoundingBox​(BoundingBox totalBox,
                                                 TileMatrix tileMatrix,
                                                 long tileColumn,
                                                 long tileRow)
        Get the bounding box of the tile column and row in the tile matrix using the total bounding box with constant units
        Parameters:
        totalBox - total bounding box
        tileMatrix - tile matrix
        tileColumn - tile column
        tileRow - tile row
        Returns:
        bounding box
        Since:
        1.2.0
      • getBoundingBox

        public static BoundingBox getBoundingBox​(BoundingBox totalBox,
                                                 long tileMatrixWidth,
                                                 long tileMatrixHeight,
                                                 long tileColumn,
                                                 long tileRow)
        Get the bounding box of the tile column and row in the tile width and height bounds using the total bounding box with constant units
        Parameters:
        totalBox - total bounding box
        tileMatrixWidth - matrix width
        tileMatrixHeight - matrix height
        tileColumn - tile column
        tileRow - tile row
        Returns:
        bounding box
        Since:
        1.2.0
      • getBoundingBox

        public static BoundingBox getBoundingBox​(BoundingBox totalBox,
                                                 TileMatrix tileMatrix,
                                                 TileGrid tileGrid)
        Get the bounding box of the tile grid in the tile matrix using the total bounding box with constant units
        Parameters:
        totalBox - total bounding box
        tileMatrix - tile matrix
        tileGrid - tile grid
        Returns:
        bounding box
        Since:
        1.2.0
      • getBoundingBox

        public static BoundingBox getBoundingBox​(BoundingBox totalBox,
                                                 long tileMatrixWidth,
                                                 long tileMatrixHeight,
                                                 TileGrid tileGrid)
        Get the bounding box of the tile grid in the tile width and height bounds using the total bounding box with constant units
        Parameters:
        totalBox - total bounding box
        tileMatrixWidth - matrix width
        tileMatrixHeight - matrix height
        tileGrid - tile grid
        Returns:
        bounding box
        Since:
        1.2.0
      • getZoomLevel

        public static int getZoomLevel​(BoundingBox webMercatorBoundingBox)
        Get the zoom level of where the web mercator bounding box fits into the complete world
        Parameters:
        webMercatorBoundingBox - web mercator bounding box
        Returns:
        zoom level
      • getPixelXSize

        public static double getPixelXSize​(BoundingBox webMercatorBoundingBox,
                                           long matrixWidth,
                                           int tileWidth)
        Get the pixel x size for the bounding box with matrix width and tile width
        Parameters:
        webMercatorBoundingBox - web mercator bounding box
        matrixWidth - matrix width
        tileWidth - tile width
        Returns:
        pixel x size
      • getPixelYSize

        public static double getPixelYSize​(BoundingBox webMercatorBoundingBox,
                                           long matrixHeight,
                                           int tileHeight)
        Get the pixel y size for the bounding box with matrix height and tile height
        Parameters:
        webMercatorBoundingBox - web mercator bounding box
        matrixHeight - matrix height
        tileHeight - tile height
        Returns:
        pixel y size
      • boundWebMercatorBoundingBox

        public static BoundingBox boundWebMercatorBoundingBox​(BoundingBox boundingBox)
        Bound the web mercator bounding box within the limits
        Parameters:
        boundingBox - web mercator bounding box
        Returns:
        bounding box
        Since:
        3.5.0
      • boundWgs84BoundingBoxWithWebMercatorLimits

        public static BoundingBox boundWgs84BoundingBoxWithWebMercatorLimits​(BoundingBox boundingBox)
        Bound the upper and lower bounds of the WGS84 bounding box with web mercator limits
        Parameters:
        boundingBox - wgs84 bounding box
        Returns:
        bounding box
        Since:
        1.1.6
      • boundDegreesBoundingBoxWithWebMercatorLimits

        public static BoundingBox boundDegreesBoundingBoxWithWebMercatorLimits​(BoundingBox boundingBox)
        Bound the upper and lower bounds of the degrees bounding box with web mercator limits
        Parameters:
        boundingBox - degrees bounding box
        Returns:
        bounding box
        Since:
        1.3.1
      • getTileGridWGS84FromWGS84

        public static TileGrid getTileGridWGS84FromWGS84​(Point point,
                                                         long zoom)
        Get the WGS84 tile grid for the point specified as WGS84
        Parameters:
        point - point
        zoom - zoom level
        Returns:
        tile grid
        Since:
        6.2.0
      • getTileGridWGS84

        public static TileGrid getTileGridWGS84​(Point point,
                                                long zoom,
                                                Projection projection)
        Get the WGS84 tile grid for the point specified as the projection
        Parameters:
        point - point
        zoom - zoom level
        projection - projection
        Returns:
        tile grid
        Since:
        6.2.0
      • getTileGridWGS84FromWebMercator

        public static TileGrid getTileGridWGS84FromWebMercator​(Point point,
                                                               long zoom)
        Get the WGS84 tile grid for the point specified as web mercator
        Parameters:
        point - point
        zoom - zoom level
        Returns:
        tile grid
        Since:
        6.2.0
      • getTileGridWGS84

        public static TileGrid getTileGridWGS84​(BoundingBox boundingBox,
                                                long zoom)
        Get the WGS84 tile grid that includes the entire tile bounding box
        Parameters:
        boundingBox - wgs84 bounding box
        zoom - zoom level
        Returns:
        tile grid
        Since:
        1.2.0
      • getWGS84BoundingBox

        public static BoundingBox getWGS84BoundingBox​(long x,
                                                      long y,
                                                      long zoom)
        Get the WGS84 tile bounding box from the WGS84 XYZ tile coordinates and zoom level
        Parameters:
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        bounding box
        Since:
        6.0.1
      • getWGS84BoundingBox

        public static BoundingBox getWGS84BoundingBox​(TileGrid tileGrid,
                                                      long zoom)
        Get the WGS84 tile bounding box from the WGS84 tile grid and zoom level
        Parameters:
        tileGrid - tile grid
        zoom - zoom
        Returns:
        wgs84 bounding box
        Since:
        1.2.0
      • tilesPerWGS84LatSide

        public static int tilesPerWGS84LatSide​(long zoom)
        Get the tiles per latitude side at the zoom level
        Parameters:
        zoom - zoom level
        Returns:
        tiles per latitude side
        Since:
        1.2.0
      • tilesPerWGS84LonSide

        public static int tilesPerWGS84LonSide​(long zoom)
        Get the tiles per longitude side at the zoom level
        Parameters:
        zoom - zoom level
        Returns:
        tiles per longitude side
        Since:
        1.2.0
      • tileSizeLatPerWGS84Side

        public static double tileSizeLatPerWGS84Side​(int tilesPerLat)
        Get the tile height in degrees latitude
        Parameters:
        tilesPerLat - tiles per latitude side
        Returns:
        degrees
        Since:
        1.2.0
      • tileSizeLonPerWGS84Side

        public static double tileSizeLonPerWGS84Side​(int tilesPerLon)
        Get the tile height in degrees longitude
        Parameters:
        tilesPerLon - tiles per longitude side
        Returns:
        degrees
        Since:
        1.2.0
      • tileGridZoom

        public static TileGrid tileGridZoom​(TileGrid tileGrid,
                                            long fromZoom,
                                            long toZoom)
        Get the tile grid starting from the tile grid and current zoom to the new zoom level
        Parameters:
        tileGrid - current tile grid
        fromZoom - current zoom level
        toZoom - new zoom level
        Returns:
        tile grid at new zoom level
        Since:
        2.0.1
      • tileGridZoomIncrease

        public static TileGrid tileGridZoomIncrease​(TileGrid tileGrid,
                                                    long zoomLevels)
        Get the tile grid starting from the tile grid and zooming in / increasing the number of levels
        Parameters:
        tileGrid - current tile grid
        zoomLevels - number of zoom levels to increase by
        Returns:
        tile grid at new zoom level
        Since:
        2.0.1
      • tileGridZoomDecrease

        public static TileGrid tileGridZoomDecrease​(TileGrid tileGrid,
                                                    long zoomLevels)
        Get the tile grid starting from the tile grid and zooming out / decreasing the number of levels
        Parameters:
        tileGrid - current tile grid
        zoomLevels - number of zoom levels to decrease by
        Returns:
        tile grid at new zoom level
        Since:
        2.0.1
      • tileGridMinZoomIncrease

        public static long tileGridMinZoomIncrease​(long min,
                                                   long zoomLevels)
        Get the new tile grid min value starting from the tile grid min and zooming in / increasing the number of levels
        Parameters:
        min - tile grid min value
        zoomLevels - number of zoom levels to increase by
        Returns:
        tile grid min value at new zoom level
        Since:
        2.0.1
      • tileGridMaxZoomIncrease

        public static long tileGridMaxZoomIncrease​(long max,
                                                   long zoomLevels)
        Get the new tile grid max value starting from the tile grid max and zooming in / increasing the number of levels
        Parameters:
        max - tile grid max value
        zoomLevels - number of zoom levels to increase by
        Returns:
        tile grid max value at new zoom level
        Since:
        2.0.1
      • tileGridMinZoomDecrease

        public static long tileGridMinZoomDecrease​(long min,
                                                   long zoomLevels)
        Get the new tile grid min value starting from the tile grid min and zooming out / decreasing the number of levels
        Parameters:
        min - tile grid min value
        zoomLevels - number of zoom levels to decrease by
        Returns:
        tile grid min value at new zoom level
        Since:
        2.0.1
      • tileGridMaxZoomDecrease

        public static long tileGridMaxZoomDecrease​(long max,
                                                   long zoomLevels)
        Get the new tile grid max value starting from the tile grid max and zooming out / decreasing the number of levels
        Parameters:
        max - tile grid max value
        zoomLevels - number of zoom levels to decrease by
        Returns:
        tile grid max value at new zoom level
        Since:
        2.0.1