public class TileBoundingBoxUtils extends Object
| Constructor and Description |
|---|
TileBoundingBoxUtils() |
| Modifier and Type | Method and Description |
|---|---|
static BoundingBox |
boundDegreesBoundingBoxWithWebMercatorLimits(BoundingBox boundingBox)
Bound the upper and lower bounds of the degrees bounding box with web
mercator limits
|
static BoundingBox |
boundWebMercatorBoundingBox(BoundingBox boundingBox)
Bound the web mercator bounding box within the limits
|
static BoundingBox |
boundWgs84BoundingBoxWithWebMercatorLimits(BoundingBox boundingBox)
Bound the upper and lower bounds of the WGS84 bounding box with web
mercator limits
|
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
|
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
|
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
|
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
|
static BoundingBox |
getBoundingBox(int x,
int y,
int zoom)
Get the tile bounding box from the XYZ tile coordinates and zoom level
|
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
|
static double |
getLatitudeFromPixel(long height,
BoundingBox boundingBox,
float pixel)
Get the latitude from the pixel location, bounding box, and image height
|
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
|
static double |
getLongitudeFromPixel(long width,
BoundingBox boundingBox,
float pixel)
Get the longitude from the pixel location, bounding box, and image width
|
static double |
getPixelXSize(BoundingBox webMercatorBoundingBox,
long matrixWidth,
int tileWidth)
Get the pixel x size for the bounding box with matrix width and tile
width
|
static double |
getPixelYSize(BoundingBox webMercatorBoundingBox,
long matrixHeight,
int tileHeight)
Get the pixel y size for the bounding box with matrix height and tile
height
|
static BoundingBox |
getProjectedBoundingBox(Long projectionEpsg,
int x,
int y,
int zoom)
Get the Projected tile bounding box from the XYZ tile coordinates and
zoom level
|
static BoundingBox |
getProjectedBoundingBox(Long projectionEpsg,
TileGrid tileGrid,
int zoom)
Get the Projected tile bounding box from the XYZ tile tileGrid and zoom
level
|
static BoundingBox |
getProjectedBoundingBox(Projection projection,
long x,
long y,
int zoom)
Get the Projected tile bounding box from the XYZ tile coordinates and
zoom level
|
static BoundingBox |
getProjectedBoundingBox(Projection projection,
TileGrid tileGrid,
int zoom)
Get the Projected tile bounding box from the XYZ tile grid and zoom level
|
static BoundingBox |
getProjectedBoundingBox(String authority,
Long code,
int x,
int y,
int zoom)
Get the Projected tile bounding box from the XYZ tile coordinates and
zoom level
|
static BoundingBox |
getProjectedBoundingBox(String authority,
Long code,
TileGrid tileGrid,
int zoom)
Get the Projected tile bounding box from the XYZ tile tileGrid and zoom
level
|
static long |
getTileColumn(BoundingBox totalBox,
long matrixWidth,
double longitude)
Get the tile column of the longitude in constant units
|
static TileGrid |
getTileGrid(BoundingBox webMercatorBoundingBox,
int zoom)
Get the tile grid that includes the entire tile bounding box
|
static TileGrid |
getTileGrid(BoundingBox totalBox,
long matrixWidth,
long matrixHeight,
BoundingBox boundingBox)
Get the tile grid
|
static TileGrid |
getTileGrid(Point point,
int zoom,
Projection projection)
Get the tile grid for the location specified as the projection
|
static TileGrid |
getTileGridFromWGS84(Point point,
int zoom)
Get the tile grid for the location specified as WGS84
|
static TileGrid |
getTileGridWGS84(BoundingBox boundingBox,
int zoom)
Get the tile grid that includes the entire tile bounding box
|
static long |
getTileRow(BoundingBox totalBox,
long matrixHeight,
double latitude)
Get the tile row of the latitude in constant units
|
static BoundingBox |
getWebMercatorBoundingBox(long x,
long y,
int zoom)
Get the Web Mercator tile bounding box from the XYZ tile coordinates and
zoom level
|
static BoundingBox |
getWebMercatorBoundingBox(TileGrid tileGrid,
int zoom)
Get the Web Mercator tile bounding box from the XYZ tile grid and zoom
level
|
static BoundingBox |
getWGS84BoundingBox(TileGrid tileGrid,
int zoom)
Get the WGS84 tile bounding box from the tile grid and zoom level
|
static float |
getXPixel(long width,
BoundingBox boundingBox,
double longitude)
Get the X pixel for where the longitude fits into the bounding box
|
static int |
getYAsOppositeTileFormat(int zoom,
int y)
Get the standard y tile location as TMS or a TMS y location as standard
|
static float |
getYPixel(long height,
BoundingBox boundingBox,
double latitude)
Get the Y pixel for where the latitude fits into the bounding box
|
static int |
getZoomLevel(BoundingBox webMercatorBoundingBox)
Get the zoom level of where the web mercator bounding box fits into the
complete world
|
static boolean |
isPointInBoundingBox(Point point,
BoundingBox boundingBox)
Determine if the point is within the bounding box
|
static boolean |
isPointInBoundingBox(Point point,
BoundingBox boundingBox,
double maxLongitude)
Determine if the point is within the bounding box
|
static BoundingBox |
overlap(BoundingBox boundingBox,
BoundingBox boundingBox2)
Get the overlapping bounding box between the two bounding boxes
|
static BoundingBox |
overlap(BoundingBox boundingBox,
BoundingBox boundingBox2,
boolean allowEmpty)
Get the overlapping bounding box between the two bounding boxes
|
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
|
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
|
static long |
tileGridMaxZoomDecrease(long max,
int zoomLevels)
Get the new tile grid max value starting from the tile grid max and
zooming out / decreasing the number of levels
|
static long |
tileGridMaxZoomIncrease(long max,
int zoomLevels)
Get the new tile grid max value starting from the tile grid max and
zooming in / increasing the number of levels
|
static long |
tileGridMinZoomDecrease(long min,
int zoomLevels)
Get the new tile grid min value starting from the tile grid min and
zooming out / decreasing the number of levels
|
static long |
tileGridMinZoomIncrease(long min,
int zoomLevels)
Get the new tile grid min value starting from the tile grid min and
zooming in / increasing the number of levels
|
static TileGrid |
tileGridZoom(TileGrid tileGrid,
int fromZoom,
int toZoom)
Get the tile grid starting from the tile grid and current zoom to the new
zoom level
|
static TileGrid |
tileGridZoomDecrease(TileGrid tileGrid,
int zoomLevels)
Get the tile grid starting from the tile grid and zooming out /
decreasing the number of levels
|
static TileGrid |
tileGridZoomIncrease(TileGrid tileGrid,
int zoomLevels)
Get the tile grid starting from the tile grid and zooming in / increasing
the number of levels
|
static double |
tileHeightDegrees(int tilesPerSide)
Get the tile height in degrees
|
static double |
tileSize(int tilesPerSide)
Get the tile size in meters
|
static double |
tileSizeLatPerWGS84Side(int tilesPerLat)
Get the tile height in degrees latitude
|
static double |
tileSizeLonPerWGS84Side(int tilesPerLon)
Get the tile height in degrees longitude
|
static double |
tileSizeWithZoom(int zoom)
Get the tile size in meters at the zoom level
|
static int |
tilesPerSide(int zoom)
Get the tiles per side, width and height, at the zoom level
|
static int |
tilesPerWGS84LatSide(int zoom)
Get the tiles per latitude side at the zoom level
|
static int |
tilesPerWGS84LonSide(int zoom)
Get the tiles per longitude side at the zoom level
|
static double |
tileWidthDegrees(int tilesPerSide)
Get the tile width in degrees
|
static double |
toleranceDistance(int zoom,
int pixels)
Get the tolerance distance in meters for the zoom level and pixels length
|
static double |
toleranceDistance(int zoom,
int pixelWidth,
int pixelHeight)
Get the tolerance distance in meters for the zoom level and pixels length
|
static BoundingBox |
toWebMercator(BoundingBox boundingBox)
Convert the bounding box coordinates to a new web mercator bounding box
|
static BoundingBox |
union(BoundingBox boundingBox,
BoundingBox boundingBox2)
Get the union bounding box combining the two bounding boxes
|
static int |
zoomFromTilesPerSide(int tilesPerSide)
Get the zoom level from the tiles per side
|
static double |
zoomLevelOfTileSize(double tileSize)
Get the zoom level from the tile size in meters
|
public static BoundingBox overlap(BoundingBox boundingBox, BoundingBox boundingBox2)
boundingBox - bounding box 1boundingBox2 - bounding box 2public static BoundingBox overlap(BoundingBox boundingBox, BoundingBox boundingBox2, boolean allowEmpty)
boundingBox - bounding boxboundingBox2 - bounding box 2allowEmpty - allow empty latitude and/or longitude ranges when determining
overlappublic static BoundingBox overlap(BoundingBox boundingBox, BoundingBox boundingBox2, double maxLongitude)
boundingBox - bounding boxboundingBox2 - bounding box 2maxLongitude - max longitude of the world for the current bounding box unitspublic static BoundingBox overlap(BoundingBox boundingBox, BoundingBox boundingBox2, double maxLongitude, boolean allowEmpty)
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
overlappublic static boolean isPointInBoundingBox(Point point, BoundingBox boundingBox)
point - bounding boxboundingBox - bounding boxpublic static boolean isPointInBoundingBox(Point point, BoundingBox boundingBox, double maxLongitude)
point - bounding boxboundingBox - bounding boxmaxLongitude - max longitude of the world for the current bounding box unitspublic static BoundingBox union(BoundingBox boundingBox, BoundingBox boundingBox2)
boundingBox - bounding box 1boundingBox2 - bounding box 2public static float getXPixel(long width,
BoundingBox boundingBox,
double longitude)
width - widthboundingBox - bounding boxlongitude - longitudepublic static double getLongitudeFromPixel(long width,
BoundingBox boundingBox,
float pixel)
width - widthboundingBox - bounding boxpixel - pixelpublic static double getLongitudeFromPixel(long width,
BoundingBox boundingBox,
BoundingBox tileBoundingBox,
float pixel)
width - widthboundingBox - bounding boxtileBoundingBox - tile bounding boxpixel - pixelpublic static float getYPixel(long height,
BoundingBox boundingBox,
double latitude)
height - heightboundingBox - bounding boxlatitude - latitudepublic static double getLatitudeFromPixel(long height,
BoundingBox boundingBox,
float pixel)
height - heightboundingBox - bounding boxpixel - pixelpublic static double getLatitudeFromPixel(long height,
BoundingBox boundingBox,
BoundingBox tileBoundingBox,
float pixel)
height - heightboundingBox - bounding boxtileBoundingBox - tile bounding boxpixel - pixelpublic static BoundingBox getBoundingBox(int x, int y, int zoom)
x - x coordinatey - y coordinatezoom - zoom levelpublic static BoundingBox getWebMercatorBoundingBox(long x, long y, int zoom)
x - x coordinatey - y coordinatezoom - zoom levelpublic static BoundingBox getWebMercatorBoundingBox(TileGrid tileGrid, int zoom)
tileGrid - tile gridzoom - zoom levelpublic static BoundingBox getProjectedBoundingBox(Long projectionEpsg, int x, int y, int zoom)
projectionEpsg - projection epsgx - x coordinatey - y coordinatezoom - zoom levelpublic static BoundingBox getProjectedBoundingBox(String authority, Long code, int x, int y, int zoom)
authority - projection authoritycode - projection codex - x coordinatey - y coordinatezoom - zoom levelpublic static BoundingBox getProjectedBoundingBox(Projection projection, long x, long y, int zoom)
projection - projectionx - x coordinatey - y coordinatezoom - zoom levelpublic static BoundingBox getProjectedBoundingBox(Long projectionEpsg, TileGrid tileGrid, int zoom)
projectionEpsg - projection epsgtileGrid - tile gridzoom - zoom levelpublic static BoundingBox getProjectedBoundingBox(String authority, Long code, TileGrid tileGrid, int zoom)
authority - projection authoritycode - projection codetileGrid - tile gridzoom - zoom levelpublic static BoundingBox getProjectedBoundingBox(Projection projection, TileGrid tileGrid, int zoom)
projection - projectiontileGrid - tile gridzoom - zoom levelpublic static TileGrid getTileGridFromWGS84(Point point, int zoom)
point - pointzoom - zoom levelpublic static TileGrid getTileGrid(Point point, int zoom, Projection projection)
point - pointzoom - zoom levelprojection - projectionpublic static TileGrid getTileGrid(BoundingBox webMercatorBoundingBox, int zoom)
webMercatorBoundingBox - web mercator bounding boxzoom - zoom levelpublic static BoundingBox toWebMercator(BoundingBox boundingBox)
boundingBox - bounding boxpublic static double tileSize(int tilesPerSide)
tilesPerSide - tiles per sidepublic static double zoomLevelOfTileSize(double tileSize)
tileSize - tile size in meterspublic static double tileWidthDegrees(int tilesPerSide)
tilesPerSide - tiles per sidepublic static double tileHeightDegrees(int tilesPerSide)
tilesPerSide - tiles per sidepublic static int tilesPerSide(int zoom)
zoom - zoom levelpublic static double tileSizeWithZoom(int zoom)
zoom - zoom levelpublic static double toleranceDistance(int zoom,
int pixels)
zoom - zoom levelpixels - pixel lengthpublic static double toleranceDistance(int zoom,
int pixelWidth,
int pixelHeight)
zoom - zoom levelpixelWidth - pixel widthpixelHeight - pixel heightpublic static int getYAsOppositeTileFormat(int zoom,
int y)
zoom - zoom levely - y coordinatepublic static int zoomFromTilesPerSide(int tilesPerSide)
tilesPerSide - tiles per sidepublic static TileGrid getTileGrid(BoundingBox totalBox, long matrixWidth, long matrixHeight, BoundingBox boundingBox)
totalBox - total bounding boxmatrixWidth - matrix widthmatrixHeight - matrix heightboundingBox - bounding boxpublic static long getTileColumn(BoundingBox totalBox, long matrixWidth, double longitude)
totalBox - total bounding boxmatrixWidth - matrix widthlongitude - in constant unitsTileMatrix.getMatrixWidth() if afterpublic static long getTileRow(BoundingBox totalBox, long matrixHeight, double latitude)
totalBox - total bounding boxmatrixHeight - matrix heightlatitude - in constant unitsTileMatrix.getMatrixHeight() if afterpublic static BoundingBox getBoundingBox(BoundingBox totalBox, TileMatrix tileMatrix, long tileColumn, long tileRow)
totalBox - total bounding boxtileMatrix - tile matrixtileColumn - tile columntileRow - tile rowpublic static BoundingBox getBoundingBox(BoundingBox totalBox, long tileMatrixWidth, long tileMatrixHeight, long tileColumn, long tileRow)
totalBox - total bounding boxtileMatrixWidth - matrix widthtileMatrixHeight - matrix heighttileColumn - tile columntileRow - tile rowpublic static BoundingBox getBoundingBox(BoundingBox totalBox, TileMatrix tileMatrix, TileGrid tileGrid)
totalBox - total bounding boxtileMatrix - tile matrixtileGrid - tile gridpublic static BoundingBox getBoundingBox(BoundingBox totalBox, long tileMatrixWidth, long tileMatrixHeight, TileGrid tileGrid)
totalBox - total bounding boxtileMatrixWidth - matrix widthtileMatrixHeight - matrix heighttileGrid - tile gridpublic static int getZoomLevel(BoundingBox webMercatorBoundingBox)
webMercatorBoundingBox - web mercator bounding boxpublic static double getPixelXSize(BoundingBox webMercatorBoundingBox, long matrixWidth, int tileWidth)
webMercatorBoundingBox - web mercator bounding boxmatrixWidth - matrix widthtileWidth - tile widthpublic static double getPixelYSize(BoundingBox webMercatorBoundingBox, long matrixHeight, int tileHeight)
webMercatorBoundingBox - web mercator bounding boxmatrixHeight - matrix heighttileHeight - tile heightpublic static BoundingBox boundWebMercatorBoundingBox(BoundingBox boundingBox)
boundingBox - web mercator bounding boxpublic static BoundingBox boundWgs84BoundingBoxWithWebMercatorLimits(BoundingBox boundingBox)
boundingBox - wgs84 bounding boxpublic static BoundingBox boundDegreesBoundingBoxWithWebMercatorLimits(BoundingBox boundingBox)
boundingBox - degrees bounding boxpublic static TileGrid getTileGridWGS84(BoundingBox boundingBox, int zoom)
boundingBox - wgs84 bounding boxzoom - zoom levelpublic static BoundingBox getWGS84BoundingBox(TileGrid tileGrid, int zoom)
tileGrid - tile gridzoom - zoompublic static int tilesPerWGS84LatSide(int zoom)
zoom - zoom levelpublic static int tilesPerWGS84LonSide(int zoom)
zoom - zoom levelpublic static double tileSizeLatPerWGS84Side(int tilesPerLat)
tilesPerLat - tiles per latitude sidepublic static double tileSizeLonPerWGS84Side(int tilesPerLon)
tilesPerLon - tiles per longitude sidepublic static TileGrid tileGridZoom(TileGrid tileGrid, int fromZoom, int toZoom)
tileGrid - current tile gridfromZoom - current zoom leveltoZoom - new zoom levelpublic static TileGrid tileGridZoomIncrease(TileGrid tileGrid, int zoomLevels)
tileGrid - current tile gridzoomLevels - number of zoom levels to increase bypublic static TileGrid tileGridZoomDecrease(TileGrid tileGrid, int zoomLevels)
tileGrid - current tile gridzoomLevels - number of zoom levels to decrease bypublic static long tileGridMinZoomIncrease(long min,
int zoomLevels)
min - tile grid min valuezoomLevels - number of zoom levels to increase bypublic static long tileGridMaxZoomIncrease(long max,
int zoomLevels)
max - tile grid max valuezoomLevels - number of zoom levels to increase bypublic static long tileGridMinZoomDecrease(long min,
int zoomLevels)
min - tile grid min valuezoomLevels - number of zoom levels to decrease bypublic static long tileGridMaxZoomDecrease(long max,
int zoomLevels)
max - tile grid max valuezoomLevels - number of zoom levels to decrease byCopyright © 2020 National Geospatial-Intelligence Agency. All rights reserved.