Package mil.nga.geopackage.tiles.user
Class TileDaoUtils
- java.lang.Object
-
- mil.nga.geopackage.tiles.user.TileDaoUtils
-
public class TileDaoUtils extends Object
Tile Data Access Object utilities- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description TileDaoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
adjustTileMatrixLengths(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Adjust the tile matrix lengths if needed.static Long
getApproximateZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double length)
Get the approximate zoom level for the provided length in the default units.static Long
getApproximateZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double width, double height)
Get the approximate zoom level for the provided width and height in the default units.static Long
getClosestZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double length)
Get the closest zoom level for the provided width and height in the default unitsstatic Long
getClosestZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double width, double height)
Get the closest zoom level for the provided width and height in the default unitsstatic long
getMapMaxZoom(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Get the map max zoom levelstatic long
getMapMinZoom(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Get the map min zoom levelstatic long
getMapZoom(TileMatrixSet tileMatrixSet, TileMatrix tileMatrix)
Get the map zoom levelstatic long[]
getMapZoomRange(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Get the map zoom level rangestatic double
getMaxLength(double[] widths, double[] heights)
Get the max distance length that matches the tile widths and heightsstatic double
getMinLength(double[] widths, double[] heights)
Get the min distance length that matches the tile widths and heightsstatic Long
getZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double length)
Get the zoom level for the provided width and height in the default unitsstatic Long
getZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double width, double height)
Get the zoom level for the provided width and height in the default units
-
-
-
Method Detail
-
adjustTileMatrixLengths
public static void adjustTileMatrixLengths(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Adjust the tile matrix lengths if needed. Check if the tile matrix width and height need to expand to account for pixel * number of pixels fitting into the tile matrix lengths- Parameters:
tileMatrixSet
- tile matrix settileMatrices
- tile matrices
-
getZoomLevel
public static Long getZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double length)
Get the zoom level for the provided width and height in the default units- Parameters:
widths
- sorted widthsheights
- sorted heightstileMatrices
- tile matriceslength
- in default units- Returns:
- tile matrix zoom level
-
getZoomLevel
public static Long getZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double width, double height)
Get the zoom level for the provided width and height in the default units- Parameters:
widths
- sorted widthsheights
- sorted heightstileMatrices
- tile matriceswidth
- in default unitsheight
- in default units- Returns:
- tile matrix zoom level
- Since:
- 1.2.1
-
getClosestZoomLevel
public static Long getClosestZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double length)
Get the closest zoom level for the provided width and height in the default units- Parameters:
widths
- sorted widthsheights
- sorted heightstileMatrices
- tile matriceslength
- in default units- Returns:
- tile matrix zoom level
- Since:
- 1.2.1
-
getClosestZoomLevel
public static Long getClosestZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double width, double height)
Get the closest zoom level for the provided width and height in the default units- Parameters:
widths
- sorted widthsheights
- sorted heightstileMatrices
- tile matriceswidth
- in default unitsheight
- in default units- Returns:
- tile matrix zoom level
- Since:
- 1.2.1
-
getApproximateZoomLevel
public static Long getApproximateZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double length)
Get the approximate zoom level for the provided length in the default units. Tiles may or may not exist for the returned zoom level. The approximate zoom level is determined using a factor of 2 from the zoom levels with tiles.- Parameters:
widths
- sorted widthsheights
- sorted heightstileMatrices
- tile matriceslength
- length in default units- Returns:
- actual or approximate tile matrix zoom level
- Since:
- 2.0.2
-
getApproximateZoomLevel
public static Long getApproximateZoomLevel(double[] widths, double[] heights, List<TileMatrix> tileMatrices, double width, double height)
Get the approximate zoom level for the provided width and height in the default units. Tiles may or may not exist for the returned zoom level. The approximate zoom level is determined using a factor of 2 from the zoom levels with tiles.- Parameters:
widths
- sorted widthsheights
- sorted heightstileMatrices
- tile matriceswidth
- width in default unitsheight
- height in default units- Returns:
- actual or approximate tile matrix zoom level
- Since:
- 2.0.2
-
getMaxLength
public static double getMaxLength(double[] widths, double[] heights)
Get the max distance length that matches the tile widths and heights- Parameters:
widths
- sorted tile matrix widthsheights
- sorted tile matrix heights- Returns:
- max length
- Since:
- 1.2.0
-
getMinLength
public static double getMinLength(double[] widths, double[] heights)
Get the min distance length that matches the tile widths and heights- Parameters:
widths
- sorted tile matrix widthsheights
- sorted tile matrix heights- Returns:
- min length
- Since:
- 1.2.0
-
getMapZoomRange
public static long[] getMapZoomRange(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Get the map zoom level range- Parameters:
tileMatrixSet
- tile matrix settileMatrices
- tile matrices- Returns:
- map zoom level range, min at index 0, max at index 1
- Since:
- 5.0.0
-
getMapMinZoom
public static long getMapMinZoom(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Get the map min zoom level- Parameters:
tileMatrixSet
- tile matrix settileMatrices
- tile matrices- Returns:
- map min zoom level
- Since:
- 5.0.0
-
getMapMaxZoom
public static long getMapMaxZoom(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices)
Get the map max zoom level- Parameters:
tileMatrixSet
- tile matrix settileMatrices
- tile matrices- Returns:
- map max zoom level
- Since:
- 5.0.0
-
getMapZoom
public static long getMapZoom(TileMatrixSet tileMatrixSet, TileMatrix tileMatrix)
Get the map zoom level- Parameters:
tileMatrixSet
- tile matrix settileMatrix
- tile matrix- Returns:
- map zoom level
- Since:
- 5.0.0
-
-