Class MBTilesHelper

    • Constructor Detail

      • MBTilesHelper

        public MBTilesHelper()
    • Method Detail

      • fillMetadata

        public void fillMetadata​(float n,
                                 float s,
                                 float w,
                                 float e,
                                 String name,
                                 String format,
                                 int minZoom,
                                 int maxZoom)
                          throws SQLException
        Throws:
        SQLException
      • triggerLastBatch

        public void triggerLastBatch()
      • getTile

        public BufferedImage getTile​(int x,
                                     int y,
                                     int z)
                              throws Exception
        Get a Tile image from the database.
        Parameters:
        x -
        y -
        z -
        Returns:
        Throws:
        Exception
      • getBounds

        public double[] getBounds()
                           throws Exception
        Get the bounds as [w,s,e,n]
        Returns:
        Throws:
        Exception
      • getImageFormat

        public String getImageFormat()
                              throws Exception
        Returns:
        the image format (jpg, png).
        Throws:
        Exception
      • readGridcoverageImageForTile

        public static BufferedImage readGridcoverageImageForTile​(org.geotools.coverage.grid.io.AbstractGridCoverage2DReader reader,
                                                                 int x,
                                                                 int y,
                                                                 int zoom,
                                                                 org.opengis.referencing.crs.CoordinateReferenceSystem resampleCrs)
                                                          throws IOException
        Read the image of a tile from a generic geotools coverage reader.
        Parameters:
        reader - the reader, expected to be in CRS 3857.
        x - the tile x.
        y - the tile y.
        zoom - the zoomlevel.
        Returns:
        the image.
        Throws:
        IOException
      • tile2lon

        public static double tile2lon​(int x,
                                      int z)
      • tile2lat

        public static double tile2lat​(int y,
                                      int z)
      • getTileXY

        public static int[] getTileXY​(double lat,
                                      double lon,
                                      int zoom)
      • tile2boundingBox

        public static org.locationtech.jts.geom.Envelope tile2boundingBox​(int x,
                                                                          int y,
                                                                          int zoom)