Package mil.nga.geopackage.tiles
Class TileBoundingBoxUtils
- java.lang.Object
-
- mil.nga.geopackage.tiles.TileBoundingBoxUtils
-
public class TileBoundingBoxUtils extends Object
Tile Bounding Box utility methods- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description TileBoundingBoxUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BoundingBox
boundDegreesBoundingBoxWithWebMercatorLimits(BoundingBox boundingBox)
Bound the upper and lower bounds of the degrees bounding box with web mercator limitsstatic BoundingBox
boundWebMercatorBoundingBox(BoundingBox boundingBox)
Bound the web mercator bounding box within the limitsstatic BoundingBox
boundWgs84BoundingBoxWithWebMercatorLimits(BoundingBox boundingBox)
Bound the upper and lower bounds of the WGS84 bounding box with web mercator limitsstatic BoundingBox
getBoundingBox(int x, int y, long zoom)
Get the tile bounding box from the XYZ tile coordinates and zoom levelstatic 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 unitsstatic 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 unitsstatic 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 unitsstatic 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 unitsstatic BoundingBox
getBoundingBoxAsWGS84(TileGrid tileGrid, long zoom)
Get the WGS84 tile bounding box from the XYZ tile tileGrid and zoom levelstatic double
getLatitudeFromPixel(long height, BoundingBox boundingBox, float pixel)
Get the latitude from the pixel location, bounding box, and image heightstatic 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 heightstatic double
getLongitudeFromPixel(long width, BoundingBox boundingBox, float pixel)
Get the longitude from the pixel location, bounding box, and image widthstatic 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 widthstatic double
getPixelXSize(BoundingBox webMercatorBoundingBox, long matrixWidth, int tileWidth)
Get the pixel x size for the bounding box with matrix width and tile widthstatic double
getPixelYSize(BoundingBox webMercatorBoundingBox, long matrixHeight, int tileHeight)
Get the pixel y size for the bounding box with matrix height and tile heightstatic BoundingBox
getProjectedBoundingBox(Long projectionEpsg, int x, int y, long zoom)
Get the Projected tile bounding box from the XYZ tile coordinates and zoom levelstatic BoundingBox
getProjectedBoundingBox(Long projectionEpsg, TileGrid tileGrid, long zoom)
Get the Projected tile bounding box from the XYZ tile tileGrid and zoom levelstatic 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 levelstatic BoundingBox
getProjectedBoundingBox(String authority, Long code, TileGrid tileGrid, long zoom)
Get the Projected tile bounding box from the XYZ tile tileGrid and zoom levelstatic BoundingBox
getProjectedBoundingBox(Projection projection, long x, long y, long zoom)
Get the Projected tile bounding box from the XYZ tile coordinates and zoom levelstatic BoundingBox
getProjectedBoundingBox(Projection projection, TileGrid tileGrid, long zoom)
Get the Projected tile bounding box from the XYZ tile grid and zoom levelstatic BoundingBox
getProjectedBoundingBoxFromWGS84(Long projectionEpsg, int x, int y, long zoom)
Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom levelstatic BoundingBox
getProjectedBoundingBoxFromWGS84(Long projectionEpsg, TileGrid tileGrid, long zoom)
Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom levelstatic 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 levelstatic BoundingBox
getProjectedBoundingBoxFromWGS84(String authority, Long code, TileGrid tileGrid, long zoom)
Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom levelstatic BoundingBox
getProjectedBoundingBoxFromWGS84(Projection projection, long x, long y, long zoom)
Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom levelstatic BoundingBox
getProjectedBoundingBoxFromWGS84(Projection projection, TileGrid tileGrid, long zoom)
Get the Projected tile bounding box from the WGS84 XYZ tile grid and zoom levelstatic BoundingBox
getTileBounds(Projection projection, Point point, int zoom)
Get the bounds of the XYZ tile at the point and zoom levelstatic BoundingBox
getTileBoundsForWebMercator(Point point, int zoom)
Get the web mercator bounds of the XYZ tile at the web mercator point and zoom levelstatic BoundingBox
getTileBoundsForWGS84(Point point, int zoom)
Get the WGS84 bounds of the XYZ tile at the WGS84 point and zoom levelstatic long
getTileColumn(BoundingBox totalBox, long matrixWidth, double longitude)
Get the tile column of the longitude in constant unitsstatic TileGrid
getTileGrid(BoundingBox webMercatorBoundingBox, long zoom)
Get the tile grid that includes the entire tile bounding boxstatic TileGrid
getTileGrid(BoundingBox totalBox, long matrixWidth, long matrixHeight, BoundingBox boundingBox)
Get the tile gridstatic TileGrid
getTileGrid(Point point, long zoom, Projection projection)
Get the tile grid for the location specified as the projectionstatic TileGrid
getTileGridFromWebMercator(Point point, long zoom)
Get the tile grid for the location specified as web mercatorstatic TileGrid
getTileGridFromWGS84(Point point, long zoom)
Get the tile grid for the location specified as WGS84static TileGrid
getTileGridWGS84(BoundingBox boundingBox, long zoom)
Get the WGS84 tile grid that includes the entire tile bounding boxstatic TileGrid
getTileGridWGS84(Point point, long zoom, Projection projection)
Get the WGS84 tile grid for the point specified as the projectionstatic TileGrid
getTileGridWGS84FromWebMercator(Point point, long zoom)
Get the WGS84 tile grid for the point specified as web mercatorstatic TileGrid
getTileGridWGS84FromWGS84(Point point, long zoom)
Get the WGS84 tile grid for the point specified as WGS84static long
getTileRow(BoundingBox totalBox, long matrixHeight, double latitude)
Get the tile row of the latitude in constant unitsstatic BoundingBox
getWebMercatorBoundingBox(long x, long y, long zoom)
Get the Web Mercator tile bounding box from the XYZ tile coordinates and zoom levelstatic BoundingBox
getWebMercatorBoundingBox(TileGrid tileGrid, long zoom)
Get the Web Mercator tile bounding box from the XYZ tile grid and zoom levelstatic BoundingBox
getWGS84BoundingBox(long x, long y, long zoom)
Get the WGS84 tile bounding box from the WGS84 XYZ tile coordinates and zoom levelstatic BoundingBox
getWGS84BoundingBox(TileGrid tileGrid, long zoom)
Get the WGS84 tile bounding box from the WGS84 tile grid and zoom levelstatic BoundingBox
getWGS84TileBounds(Projection projection, Point point, int zoom)
Get the bounds of the WGS84 tile at the point and zoom levelstatic BoundingBox
getWGS84TileBoundsForWebMercator(Point point, int zoom)
Get the web mercator bounds of the WGS84 tile at the web mercator point and zoom levelstatic BoundingBox
getWGS84TileBoundsForWGS84(Point point, int zoom)
Get the WGS84 bounds of the WGS84 tile at the WGS84 point and zoom levelstatic float
getXPixel(long width, BoundingBox boundingBox, double longitude)
Get the X pixel for where the longitude fits into the bounding boxstatic int
getYAsOppositeTileFormat(long zoom, int y)
Get the standard y tile location as TMS or a TMS y location as standardstatic float
getYPixel(long height, BoundingBox boundingBox, double latitude)
Get the Y pixel for where the latitude fits into the bounding boxstatic int
getZoomLevel(BoundingBox webMercatorBoundingBox)
Get the zoom level of where the web mercator bounding box fits into the complete worldstatic boolean
isPointInBoundingBox(Point point, BoundingBox boundingBox)
Determine if the point is within the bounding boxstatic boolean
isPointInBoundingBox(Point point, BoundingBox boundingBox, double maxLongitude)
Determine if the point is within the bounding boxstatic BoundingBox
overlap(BoundingBox boundingBox, BoundingBox boundingBox2)
Get the overlapping bounding box between the two bounding boxesstatic BoundingBox
overlap(BoundingBox boundingBox, BoundingBox boundingBox2, boolean allowEmpty)
Get the overlapping bounding box between the two bounding boxesstatic 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 longitudestatic 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 longitudestatic 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 levelsstatic 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 levelsstatic 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 levelsstatic 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 levelsstatic TileGrid
tileGridZoom(TileGrid tileGrid, long fromZoom, long toZoom)
Get the tile grid starting from the tile grid and current zoom to the new zoom levelstatic TileGrid
tileGridZoomDecrease(TileGrid tileGrid, long zoomLevels)
Get the tile grid starting from the tile grid and zooming out / decreasing the number of levelsstatic TileGrid
tileGridZoomIncrease(TileGrid tileGrid, long zoomLevels)
Get the tile grid starting from the tile grid and zooming in / increasing the number of levelsstatic double
tileHeightDegrees(int tilesPerSide)
Get the tile height in degreesstatic double
tileSize(int tilesPerSide)
Get the tile size in metersstatic double
tileSize(int tilesPerSide, double totalLength)
Get the tile size in length unitsstatic double
tileSizeLatPerWGS84Side(int tilesPerLat)
Get the tile height in degrees latitudestatic double
tileSizeLonPerWGS84Side(int tilesPerLon)
Get the tile height in degrees longitudestatic double
tileSizeWithZoom(long zoom)
Get the tile size in meters at the zoom levelstatic double
tileSizeWithZoom(long zoom, double totalLength)
Get the tile size in length units at the zoom levelstatic int
tilesPerSide(long zoom)
Get the tiles per side, width and height, at the zoom levelstatic int
tilesPerWGS84LatSide(long zoom)
Get the tiles per latitude side at the zoom levelstatic int
tilesPerWGS84LonSide(long zoom)
Get the tiles per longitude side at the zoom levelstatic double
tileWidthDegrees(int tilesPerSide)
Get the tile width in degreesstatic double
toleranceDistance(long zoom, int pixels)
Get the tolerance distance in meters for the zoom level and pixels lengthstatic double
toleranceDistance(long zoom, int pixelWidth, int pixelHeight)
Get the tolerance distance in meters for the zoom level and pixels lengthstatic BoundingBox
toWebMercator(BoundingBox boundingBox)
Convert the bounding box coordinates to a new web mercator bounding boxstatic BoundingBox
union(BoundingBox boundingBox, BoundingBox boundingBox2)
Get the union bounding box combining the two bounding boxesstatic int
zoomFromTilesPerSide(int tilesPerSide)
Get the zoom level from the tiles per sidestatic double
zoomLevelOfTileSize(double tileSize)
Get the zoom level from the tile size in metersstatic double
zoomLevelOfTileSize(double tileSize, double totalLength)
Get the zoom level from the tile size in length units
-
-
-
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 1boundingBox2
- 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 boxboundingBox2
- bounding box 2allowEmpty
- 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 boxboundingBox2
- bounding box 2maxLongitude
- 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 boxboundingBox2
- bounding box 2maxLongitude
- max longitude of the world for the current bounding box unitsallowEmpty
- 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 boxboundingBox
- 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 boxboundingBox
- bounding boxmaxLongitude
- 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 1boundingBox2
- 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
- widthboundingBox
- bounding boxlongitude
- 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
- widthboundingBox
- bounding boxpixel
- 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
- widthboundingBox
- bounding boxtileBoundingBox
- tile bounding boxpixel
- 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
- heightboundingBox
- bounding boxlatitude
- 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
- heightboundingBox
- bounding boxpixel
- 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
- heightboundingBox
- bounding boxtileBoundingBox
- tile bounding boxpixel
- 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 coordinatey
- y coordinatezoom
- 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 coordinatey
- y coordinatezoom
- 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 gridzoom
- 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 epsgx
- x coordinatey
- y coordinatezoom
- 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 authoritycode
- projection codex
- x coordinatey
- y coordinatezoom
- 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
- projectionx
- x coordinatey
- y coordinatezoom
- 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 epsgtileGrid
- tile gridzoom
- 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 authoritycode
- projection codetileGrid
- tile gridzoom
- 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
- projectiontileGrid
- tile gridzoom
- 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 gridzoom
- 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 epsgx
- x coordinatey
- y coordinatezoom
- 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 authoritycode
- projection codex
- x coordinatey
- y coordinatezoom
- 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
- projectionx
- x coordinatey
- y coordinatezoom
- 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 epsgtileGrid
- tile gridzoom
- 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 authoritycode
- projection codetileGrid
- tile gridzoom
- 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
- projectiontileGrid
- tile gridzoom
- 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
- pointzoom
- 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
- pointzoom
- zoom levelprojection
- 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
- pointzoom
- 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 boxzoom
- 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 projectionpoint
- point locationzoom
- 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 pointzoom
- 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 pointzoom
- 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 projectionpoint
- point locationzoom
- 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 pointzoom
- 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 pointzoom
- 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 sidetotalLength
- 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 unitstotalLength
- 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 leveltotalLength
- 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 levelpixels
- 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 levelpixelWidth
- pixel widthpixelHeight
- 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 levely
- 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 boxmatrixWidth
- matrix widthmatrixHeight
- matrix heightboundingBox
- 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 boxmatrixWidth
- matrix widthlongitude
- 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 boxmatrixHeight
- matrix heightlatitude
- 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 boxtileMatrix
- tile matrixtileColumn
- tile columntileRow
- 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 boxtileMatrixWidth
- matrix widthtileMatrixHeight
- matrix heighttileColumn
- tile columntileRow
- 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 boxtileMatrix
- tile matrixtileGrid
- 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 boxtileMatrixWidth
- matrix widthtileMatrixHeight
- matrix heighttileGrid
- 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 boxmatrixWidth
- matrix widthtileWidth
- 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 boxmatrixHeight
- matrix heighttileHeight
- 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
- pointzoom
- 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
- pointzoom
- zoom levelprojection
- 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
- pointzoom
- 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 boxzoom
- 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 coordinatey
- y coordinatezoom
- 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 gridzoom
- 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 gridfromZoom
- current zoom leveltoZoom
- 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 gridzoomLevels
- 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 gridzoomLevels
- 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 valuezoomLevels
- 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 valuezoomLevels
- 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 valuezoomLevels
- 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 valuezoomLevels
- number of zoom levels to decrease by- Returns:
- tile grid max value at new zoom level
- Since:
- 2.0.1
-
-