/** * {@inheritDoc} */ @Override public BoundingBox getBoundingBox() { return tileMatrixSet.getBoundingBox(); }
/** * Constructor * * @param geoPackage * GeoPackage * @param tileMatrixSet * tile matrix set */ public TileTableScaling(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet) { this(geoPackage, tileMatrixSet.getTableName()); }
/** * Text output from a TileMatrixSet * * @param tileMatrixSet * tile matrix set * @return text */ public String textOutput(TileMatrixSet tileMatrixSet) { StringBuilder output = new StringBuilder(); output.append("\t" + TileMatrixSet.COLUMN_TABLE_NAME + ": " + tileMatrixSet.getTableName()); output.append("\n" + textOutput(tileMatrixSet.getSrs())); output.append("\n\t" + TileMatrixSet.COLUMN_MIN_X + ": " + tileMatrixSet.getMinX()); output.append("\n\t" + TileMatrixSet.COLUMN_MIN_Y + ": " + tileMatrixSet.getMinY()); output.append("\n\t" + TileMatrixSet.COLUMN_MAX_X + ": " + tileMatrixSet.getMaxX()); output.append("\n\t" + TileMatrixSet.COLUMN_MAX_Y + ": " + tileMatrixSet.getMaxY()); return output.toString(); }
try { TileMatrixSet tileMatrixSet = getTileMatrixSetDao() .queryForId(table); tableBoundingBox = tileMatrixSet.getBoundingBox(projection); } catch (SQLException e) { throw new GeoPackageException(
/** * Get all the tile table names * * @return tile tables * @throws SQLException * upon failure */ public List<String> getTileTables() throws SQLException { List<String> tableNames = new ArrayList<String>(); List<TileMatrixSet> tileMatrixSets = queryForAll(); for (TileMatrixSet tileMatrixSet : tileMatrixSets) { tableNames.add(tileMatrixSet.getTableName()); } return tableNames; }
/** * Get the projection * * @return projection * @since 3.1.0 */ public Projection getProjection() { return getSrs().getProjection(); }
/** * 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 * * @param tileMatrixSet * tile matrix set * @param tileMatrices * tile matrices */ public static void adjustTileMatrixLengths(TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices) { double tileMatrixWidth = tileMatrixSet.getMaxX() - tileMatrixSet.getMinX(); double tileMatrixHeight = tileMatrixSet.getMaxY() - tileMatrixSet.getMinY(); for (TileMatrix tileMatrix : tileMatrices) { int tempMatrixWidth = (int) (tileMatrixWidth / (tileMatrix .getPixelXSize() * tileMatrix.getTileWidth())); int tempMatrixHeight = (int) (tileMatrixHeight / (tileMatrix .getPixelYSize() * tileMatrix.getTileHeight())); if (tempMatrixWidth > tileMatrix.getMatrixWidth()) { tileMatrix.setMatrixWidth(tempMatrixWidth); } if (tempMatrixHeight > tileMatrix.getMatrixHeight()) { tileMatrix.setMatrixHeight(tempMatrixHeight); } } }
/** * Set the tile matrix set * * @param tileMatrixSet * tile matrix set */ public void setTileMatrixSet(TileMatrixSet tileMatrixSet) { this.tileMatrixSet = tileMatrixSet; if (tileMatrixSet != null) { tileMatrixSetName = tileMatrixSet.getTableName(); } else { tileMatrixSetName = null; } }
/** * {@inheritDoc} */ @Override public BoundingBox getBoundingBox(Projection projection) { return tileMatrixSet.getBoundingBox(projection); }
/** * Determine if the Tile Matrix Set has the extension * * @return true if has extension */ public boolean has() { boolean exists = has(EXTENSION_NAME, tileMatrixSet.getTableName(), TileTable.COLUMN_TILE_DATA); return exists; }
/** * {@inheritDoc} */ @Override public BoundingBox getBoundingBox() { return tileMatrixSet.getBoundingBox(); }
/** * Delete by tile matrix set * * @param tileMatrixSet * tile matrix set * @return deleted count */ public int delete(TileMatrixSet tileMatrixSet) { return delete(tileMatrixSet.getTableName()); }
/** * {@inheritDoc} */ @Override public BoundingBox getBoundingBox(Projection projection) { return tileMatrixSet.getBoundingBox(projection); }
/** * Query by tile matrix set * * @param tileMatrixSet * tile matrix set * @return gridded coverage */ public GriddedCoverage query(TileMatrixSet tileMatrixSet) { return query(tileMatrixSet.getTableName()); }
/** * Set the tile matrix set * * @param tileMatrixSet * tile matrix set */ public void setTileMatrixSet(TileMatrixSet tileMatrixSet) { setTableName(tileMatrixSet != null ? tileMatrixSet.getTableName() : null); }
/** * Get the gridded tile by id * * @param tileId * tile id * @return gridded tile */ public GriddedTile getGriddedTile(long tileId) { GriddedTile griddedTile = null; try { if (griddedTileDao.isTableExists()) { griddedTile = griddedTileDao.query( tileMatrixSet.getTableName(), tileId); } } catch (SQLException e) { throw new GeoPackageException( "Failed to get Gridded Tile for table name: " + tileMatrixSet.getTableName() + ", tile id: " + tileId, e); } return griddedTile; }
/** * Get the gridded tile * * @return gridded tiles */ public List<GriddedTile> getGriddedTile() { List<GriddedTile> griddedTile = null; try { if (griddedTileDao.isTableExists()) { griddedTile = griddedTileDao .query(tileMatrixSet.getTableName()); } } catch (SQLException e) { throw new GeoPackageException( "Failed to get Gridded Tile for table name: " + tileMatrixSet.getTableName(), e); } return griddedTile; }
/** * Query and update the gridded coverage * * @return gridded coverage */ public GriddedCoverage queryGriddedCoverage() { try { if (griddedCoverageDao.isTableExists()) { griddedCoverage = griddedCoverageDao.query(tileMatrixSet); } } catch (SQLException e) { throw new GeoPackageException( "Failed to get Gridded Coverage for table name: " + tileMatrixSet.getTableName(), e); } return griddedCoverage; }