/** * Get table names by data type * * @param dataType * data type * @return table names * @throws SQLException * upon query error * @since 1.2.1 */ public List<String> getTables(ContentsDataType dataType) throws SQLException { return getTables(dataType.getName()); }
/** * {@inheritDoc} */ @Override public List<String> getTables() { ContentsDao contentDao = getContentsDao(); List<String> tables; try { tables = contentDao.getTables(); } catch (SQLException e) { throw new GeoPackageException("Failed to retrieve tables", e); } return tables; }
/** * {@inheritDoc} */ @Override public List<String> getTables(String type) { ContentsDao contentDao = getContentsDao(); List<String> tableNames; try { tableNames = contentDao.getTables(type); } catch (SQLException e) { throw new GeoPackageException("Failed to retrieve " + type + " tables", e); } return tableNames; }
/** * Get the bounding box for all tables in the provided projection * * @param projection * desired bounding box projection * * @return bounding box * @since 3.1.0 */ public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = null; List<String> tables = null; try { tables = getTables(); } catch (SQLException e) { throw new GeoPackageException( "Failed to query for contents tables", e); } for (String table : tables) { BoundingBox tableBoundingBox = getBoundingBox(projection, table); if (tableBoundingBox != null) { if (boundingBox != null) { boundingBox = boundingBox.union(tableBoundingBox); } else { boundingBox = tableBoundingBox; } } } return boundingBox; }
TestCase.assertFalse(contentsDao.getTables().contains( mediaTable.getTableName())); ExtendedRelation extendedRelation = rte.addMediaRelationship( TestCase.assertTrue(geoPackage.getDatabase().tableExists( mediaTable.getTableName())); TestCase.assertTrue(contentsDao.getTables().contains( mediaTable.getTableName())); validateContents(mediaTable,
TestCase.assertFalse(contentsDao.getTables().contains( simpleTable.getTableName())); ExtendedRelation extendedRelation = rte TestCase.assertTrue(geoPackage.getDatabase().tableExists( simpleTable.getTableName())); TestCase.assertTrue(contentsDao.getTables().contains( simpleTable.getTableName())); validateContents(simpleTable,