Class TileDaoUtils


  • public class TileDaoUtils
    extends Object
    Tile Data Access Object utilities
    Author:
    osbornb
    • Constructor Detail

      • TileDaoUtils

        public TileDaoUtils()
    • 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 set
        tileMatrices - 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 widths
        heights - sorted heights
        tileMatrices - tile matrices
        length - 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 widths
        heights - sorted heights
        tileMatrices - tile matrices
        width - in default units
        height - 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 widths
        heights - sorted heights
        tileMatrices - tile matrices
        length - 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 widths
        heights - sorted heights
        tileMatrices - tile matrices
        width - in default units
        height - 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 widths
        heights - sorted heights
        tileMatrices - tile matrices
        length - 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 widths
        heights - sorted heights
        tileMatrices - tile matrices
        width - width in default units
        height - 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 widths
        heights - 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 widths
        heights - 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 set
        tileMatrices - 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 set
        tileMatrices - 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 set
        tileMatrices - 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 set
        tileMatrix - tile matrix
        Returns:
        map zoom level
        Since:
        5.0.0