Package mil.nga.geopackage
Class GeoPackageCoreImpl
- java.lang.Object
-
- mil.nga.geopackage.GeoPackageCoreImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,GeoPackageCore
public abstract class GeoPackageCoreImpl extends Object implements GeoPackageCore
A single GeoPackage database connection implementation- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanwritableWritable GeoPackage flag
-
Constructor Summary
Constructors Modifier Constructor Description protectedGeoPackageCoreImpl(String name, String path, GeoPackageCoreConnection database)ConstructorprotectedGeoPackageCoreImpl(String name, String path, GeoPackageCoreConnection database, boolean writable)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TcallInTransaction(Callable<T> callable)Execute theCallableclass inside an ORMLite transactionvoidclose()Close the GeoPackage connectionprotected voidcopyAttributeTable(String tableName, String newTableName, boolean transferContent)Copy the attribute tableprotected ContentscopyContents(String tableName, String newTableName)Copy the contentsprotected voidcopyFeatureTable(String tableName, String newTableName, boolean transferContent)Copy the feature tablevoidcopyTable(String tableName, String newTableName)Copy the table with transferred contents and extensionsprotected voidcopyTable(String tableName, String newTableName, boolean transferContent, boolean extensions)Copy the tablevoidcopyTableAsEmpty(String tableName, String newTableName)Copy the table but leave the user table empty and without extensionsvoidcopyTableNoExtensions(String tableName, String newTableName)Copy the table with transferred contents but no extensionsprotected voidcopyTileTable(String tableName, String newTableName, boolean transferContent)Copy the tile tableprotected ContentscopyUserTable(String tableName, String newTableName, boolean transferContent)Copy the user tableprotected ContentscopyUserTable(String tableName, String newTableName, boolean transferContent, boolean validateContents)Copy the user tablevoidcreateAttributesTable(AttributesTable table)Create a new attributes tableAttributesTablecreateAttributesTable(AttributesTableMetadata metadata)Create a new attributes table with GeoPackage metadata including: user attributes table and contents row.<D extends GeoPackageDao<T,?>,T>
DcreateDao(Class<T> type)Create a daobooleancreateExtensionsTable()Create the Extensions table if it does not already existvoidcreateFeatureTable(FeatureTable table)Create a new feature tableFeatureTablecreateFeatureTable(FeatureTableMetadata metadata)Create a new feature table with GeoPackage metadata including: geometry columns table and row, user feature table, and contents row.booleancreateGeometryColumnsTable()Create the Geometry Columns table if it does not already existbooleancreateTileMatrixSetTable()Create the Tile Matrix Set table if it does not already existbooleancreateTileMatrixTable()Create the Tile Matrix table if it does not already existvoidcreateTileTable(TileTable table)Create a new tile tableTileTablecreateTileTable(TileTableMetadata metadata)Create a new tile table with GeoPackage metadata including: tile matrix set table and row, tile matrix table, user tile table, and contents row.voidcreateUserTable(UserTable<? extends UserColumn> table)Create a new user tablevoiddeleteTable(String table)Delete the user table (a feature or tile table) and all GeoPackage metadatavoiddeleteTableQuietly(String tableName)Attempt to delete the user table (a feature or tile table) and all GeoPackage metadata quietlyvoiddropTable(String table)Drop the table if it exists.voiddropView(String view)Drop the view if it exists.booleanenableForeignKeys()If foreign keys is disabled and there are no foreign key violations, enables foreign key checks, else logs violationsvoidendAndBeginTransaction()End a transaction as successful and begin a new transactionvoidendTransaction()End a transaction successfullyvoidfailTransaction()Fail a transactionbooleanforeignKeys()Query for the foreign keys valuebooleanforeignKeys(boolean on)Change the foreign keys stateStringgetApplicationId()Get the application idStringgetApplicationIdHex()Get the application id as a hex string prefixed with 0xIntegergetApplicationIdInteger()Get the application id integerList<String>getAttributesTables()Get the attributes tablesBoundingBoxgetBoundingBox(String table)Get the bounding box for the table in the table's projection, including contents and table metadataBoundingBoxgetBoundingBox(String table, boolean manual)Get the bounding box for the table in the table's projection, including contents, table metadata, and manual queries if enabledBoundingBoxgetBoundingBox(Projection projection)Get the bounding box for all tables in the provided projection, including contents and table metadataBoundingBoxgetBoundingBox(Projection projection, boolean manual)Get the bounding box for all tables in the provided projection, including contents, table metadata, and manual queries if enabledBoundingBoxgetBoundingBox(Projection projection, String table)Get the bounding box for the table in the provided projection, including contents and table metadataBoundingBoxgetBoundingBox(Projection projection, String table, boolean manual)Get the bounding box for the table in the provided projection, including contents, table metadata, and manual queries if enabledBoundingBoxgetContentsBoundingBox(String table)Get the bounding box from the contents for the table in the table's projectionBoundingBoxgetContentsBoundingBox(Projection projection)Get the bounding box for all table contents in the provided projectionBoundingBoxgetContentsBoundingBox(Projection projection, String table)Get the bounding box from the contents for the table in the provided projectionContentsDaogetContentsDao()Get a Contents DAOProjectiongetContentsProjection(String table)Get the projection of the table contentsGeoPackageCoreConnectiongetDatabase()Get the SQLite databaseExtensionManagergetExtensionManager()Get an extension manager on the GeoPackageExtensionsDaogetExtensionsDao()Get an Extensions DAOList<String>getFeatureTables()Get the feature tablesGeometryColumnsDaogetGeometryColumnsDao()Get a Geometry Columns DAOStringgetName()Get the GeoPackage nameStringgetPath()Get the GeoPackage pathProjectiongetProjection(String table)Get the projection of the tableSpatialReferenceSystemDaogetSpatialReferenceSystemDao()Get a Spatial Reference System DAOBoundingBoxgetTableBoundingBox(String table)Get the bounding box for the table in the table's projection, using only table metadataBoundingBoxgetTableBoundingBox(String table, boolean manual)Get the bounding box for the table in the table's projection, using only table metadata and manual queries if enabledBoundingBoxgetTableBoundingBox(Projection projection)Get the bounding box for all tables in the provided projection, using only table metadataBoundingBoxgetTableBoundingBox(Projection projection, boolean manual)Get the bounding box for all tables in the provided projection, using only table metadata and manual queries if enabledBoundingBoxgetTableBoundingBox(Projection projection, String table)Get the bounding box for the table in the provided projection, using only table metadataBoundingBoxgetTableBoundingBox(Projection projection, String table, boolean manual)Get the bounding box for the table in the provided projection, using only table metadata and manual queries if enabledContentsgetTableContents(String table)Get the contents of the user tableContentsDataTypegetTableCoreDataType(String table)Get the data type of the user table only if it is a core data type (features, tiles, attributes)GeoPackageTableCreatorgetTableCreator()Get the Table CreatorContentsDataTypegetTableDataType(String table)Get the contents data type of the user tableList<String>getTables()Get all tablesList<String>getTables(String type)Get the tables for the contents data typeList<String>getTables(String... types)Get the tables for the contents data typesList<String>getTables(ContentsDataType type)Get the tables for the contents data typeList<String>getTables(ContentsDataType... types)Get the tables for the contents data typesStringgetTableType(String table)Get the contents data type of the user tableTileMatrixDaogetTileMatrixDao()Get a Tile Matrix DAOTileMatrixSetDaogetTileMatrixSetDao()Get a Tile Matrix Set DAOList<String>getTileTables()Get the tile tablesList<Contents>getTypeContents(String type)Get the contents for the data typeList<Contents>getTypeContents(String... types)Get the contents for the data typesList<Contents>getTypeContents(ContentsDataType type)Get the contents for the data typeList<Contents>getTypeContents(ContentsDataType... types)Get the contents for the data typesIntegergetUserVersion()Get the user versionIntegergetUserVersionMajor()Get the major user versionIntegergetUserVersionMinor()Get the minor user versionIntegergetUserVersionPatch()Get the patch user versionbooleanisAttributeTable(String table)Check if the table is an attribute tablebooleanisContentsTable(String table)Check if the table exists as a user contents tablebooleanisFeatureTable(String table)Check if the table is a feature tablebooleanisTable(String table)Check if the table existsbooleanisTableCoreDataType(String table)Determine if the user table is one of the core data types (features, tiles, attributes)booleanisTableOrView(String name)Check if the table or view existsbooleanisTableType(String table, String type)Check if the table is the provided typebooleanisTableType(String table, String... types)Check if the table is one of the provided typesbooleanisTableType(String table, ContentsDataType type)Check if the table is the provided typebooleanisTableType(String table, ContentsDataType... types)Check if the table is one of the provided typesbooleanisTileTable(String table)Check if the table is a tile tablebooleanisView(String view)Check if the view existsbooleanisWritable()Is the GeoPackage writablevoidrenameTable(String tableName, String newTableName)Rename the tablevoidsaveSchema(UserTable<? extends UserColumn> table)Save the table schema using theSchemaExtensionvoidvacuum()Rebuild the GeoPackage, repacking it into a minimal amount of disk spacevoidverifyWritable()Verify the GeoPackage is writable and throw an exception if it is not-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface mil.nga.geopackage.GeoPackageCore
beginTransaction, commit, endTransaction, execSQL, getFeatureBoundingBox, inTransaction
-
-
-
-
Constructor Detail
-
GeoPackageCoreImpl
protected GeoPackageCoreImpl(String name, String path, GeoPackageCoreConnection database)
Constructor- Parameters:
name- namepath- pathdatabase- database- Since:
- 4.0.0
-
GeoPackageCoreImpl
protected GeoPackageCoreImpl(String name, String path, GeoPackageCoreConnection database, boolean writable)
Constructor- Parameters:
name- namepath- pathdatabase- databasewritable- true if writable- Since:
- 4.0.0
-
-
Method Detail
-
close
public void close()
Close the GeoPackage connection- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceGeoPackageCore
-
getName
public String getName()
Get the GeoPackage name- Specified by:
getNamein interfaceGeoPackageCore- Returns:
- name
-
getPath
public String getPath()
Get the GeoPackage path- Specified by:
getPathin interfaceGeoPackageCore- Returns:
- path
-
getDatabase
public GeoPackageCoreConnection getDatabase()
Get the SQLite database- Specified by:
getDatabasein interfaceGeoPackageCore- Returns:
- connection
-
getTableCreator
public GeoPackageTableCreator getTableCreator()
Get the Table Creator- Specified by:
getTableCreatorin interfaceGeoPackageCore- Returns:
- table creator
-
isWritable
public boolean isWritable()
Is the GeoPackage writable- Specified by:
isWritablein interfaceGeoPackageCore- Returns:
- true if writable
-
getApplicationId
public String getApplicationId()
Get the application id- Specified by:
getApplicationIdin interfaceGeoPackageCore- Returns:
- application id
-
getApplicationIdInteger
public Integer getApplicationIdInteger()
Get the application id integer- Specified by:
getApplicationIdIntegerin interfaceGeoPackageCore- Returns:
- application id integer
-
getApplicationIdHex
public String getApplicationIdHex()
Get the application id as a hex string prefixed with 0x- Specified by:
getApplicationIdHexin interfaceGeoPackageCore- Returns:
- application id hex string
-
getUserVersion
public Integer getUserVersion()
Get the user version- Specified by:
getUserVersionin interfaceGeoPackageCore- Returns:
- user version
-
getUserVersionMajor
public Integer getUserVersionMajor()
Get the major user version- Specified by:
getUserVersionMajorin interfaceGeoPackageCore- Returns:
- major user version
-
getUserVersionMinor
public Integer getUserVersionMinor()
Get the minor user version- Specified by:
getUserVersionMinorin interfaceGeoPackageCore- Returns:
- minor user version
-
getUserVersionPatch
public Integer getUserVersionPatch()
Get the patch user version- Specified by:
getUserVersionPatchin interfaceGeoPackageCore- Returns:
- patch user version
-
getFeatureTables
public List<String> getFeatureTables()
Get the feature tables- Specified by:
getFeatureTablesin interfaceGeoPackageCore- Returns:
- table names
-
getTileTables
public List<String> getTileTables()
Get the tile tables- Specified by:
getTileTablesin interfaceGeoPackageCore- Returns:
- table names
-
getAttributesTables
public List<String> getAttributesTables()
Get the attributes tables- Specified by:
getAttributesTablesin interfaceGeoPackageCore- Returns:
- table name
-
getTables
public List<String> getTables(ContentsDataType type)
Get the tables for the contents data type- Specified by:
getTablesin interfaceGeoPackageCore- Parameters:
type- data type- Returns:
- table names
-
getTables
public List<String> getTables(ContentsDataType... types)
Get the tables for the contents data types- Specified by:
getTablesin interfaceGeoPackageCore- Parameters:
types- data types- Returns:
- table names
-
getTables
public List<String> getTables(String type)
Get the tables for the contents data type- Specified by:
getTablesin interfaceGeoPackageCore- Parameters:
type- data type- Returns:
- table names
-
getTables
public List<String> getTables(String... types)
Get the tables for the contents data types- Specified by:
getTablesin interfaceGeoPackageCore- Parameters:
types- data types- Returns:
- table names
-
getTypeContents
public List<Contents> getTypeContents(ContentsDataType type)
Get the contents for the data type- Specified by:
getTypeContentsin interfaceGeoPackageCore- Parameters:
type- data type- Returns:
- contents
-
getTypeContents
public List<Contents> getTypeContents(ContentsDataType... types)
Get the contents for the data types- Specified by:
getTypeContentsin interfaceGeoPackageCore- Parameters:
types- data types- Returns:
- contents
-
getTypeContents
public List<Contents> getTypeContents(String type)
Get the contents for the data type- Specified by:
getTypeContentsin interfaceGeoPackageCore- Parameters:
type- data type- Returns:
- contents
-
getTypeContents
public List<Contents> getTypeContents(String... types)
Get the contents for the data types- Specified by:
getTypeContentsin interfaceGeoPackageCore- Parameters:
types- data types- Returns:
- contents
-
getTables
public List<String> getTables()
Get all tables- Specified by:
getTablesin interfaceGeoPackageCore- Returns:
- table names
-
isFeatureTable
public boolean isFeatureTable(String table)
Check if the table is a feature table- Specified by:
isFeatureTablein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- true if a feature table
-
isTileTable
public boolean isTileTable(String table)
Check if the table is a tile table- Specified by:
isTileTablein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- true if a tile table
-
isAttributeTable
public boolean isAttributeTable(String table)
Check if the table is an attribute table- Specified by:
isAttributeTablein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- true if an attribute table
-
isTableType
public boolean isTableType(String table, ContentsDataType type)
Check if the table is the provided type- Specified by:
isTableTypein interfaceGeoPackageCore- Parameters:
table- table nametype- data type- Returns:
- true if the type of table
-
isTableType
public boolean isTableType(String table, ContentsDataType... types)
Check if the table is one of the provided types- Specified by:
isTableTypein interfaceGeoPackageCore- Parameters:
table- table nametypes- data types- Returns:
- true if the type of table
-
isTableType
public boolean isTableType(String table, String type)
Check if the table is the provided type- Specified by:
isTableTypein interfaceGeoPackageCore- Parameters:
table- table nametype- data type- Returns:
- true if the type of table
-
isTableType
public boolean isTableType(String table, String... types)
Check if the table is one of the provided types- Specified by:
isTableTypein interfaceGeoPackageCore- Parameters:
table- table nametypes- data types- Returns:
- true if the type of table
-
isContentsTable
public boolean isContentsTable(String table)
Check if the table exists as a user contents table- Specified by:
isContentsTablein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- true if a user contents table
-
isTable
public boolean isTable(String table)
Check if the table exists- Specified by:
isTablein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- true if a table
-
isView
public boolean isView(String view)
Check if the view exists- Specified by:
isViewin interfaceGeoPackageCore- Parameters:
view- view name- Returns:
- true if a view
-
isTableOrView
public boolean isTableOrView(String name)
Check if the table or view exists- Specified by:
isTableOrViewin interfaceGeoPackageCore- Parameters:
name- table or view name- Returns:
- true if a table or view
-
getTableContents
public Contents getTableContents(String table)
Get the contents of the user table- Specified by:
getTableContentsin interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- contents
-
getTableType
public String getTableType(String table)
Get the contents data type of the user table- Specified by:
getTableTypein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- table type
-
getTableDataType
public ContentsDataType getTableDataType(String table)
Get the contents data type of the user table- Specified by:
getTableDataTypein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- table type or null if not an enumerated type
-
getTableCoreDataType
public ContentsDataType getTableCoreDataType(String table)
Get the data type of the user table only if it is a core data type (features, tiles, attributes)- Specified by:
getTableCoreDataTypein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- core data type or null
-
isTableCoreDataType
public boolean isTableCoreDataType(String table)
Determine if the user table is one of the core data types (features, tiles, attributes)- Specified by:
isTableCoreDataTypein interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- true if a core data type
-
getContentsBoundingBox
public BoundingBox getContentsBoundingBox(Projection projection)
Get the bounding box for all table contents in the provided projection- Specified by:
getContentsBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projection- Returns:
- bounding box
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection)
Get the bounding box for all tables in the provided projection, including contents and table metadata- Specified by:
getBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projection- Returns:
- bounding box
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection, boolean manual)
Get the bounding box for all tables in the provided projection, including contents, table metadata, and manual queries if enabled- Specified by:
getBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projectionmanual- manual query flag, true to determine missing bounds manually- Returns:
- bounding box
-
getTableBoundingBox
public BoundingBox getTableBoundingBox(Projection projection)
Get the bounding box for all tables in the provided projection, using only table metadata- Specified by:
getTableBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projection- Returns:
- bounding box
-
getTableBoundingBox
public BoundingBox getTableBoundingBox(Projection projection, boolean manual)
Get the bounding box for all tables in the provided projection, using only table metadata and manual queries if enabled- Specified by:
getTableBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projectionmanual- manual query flag, true to determine missing bounds manually- Returns:
- bounding box
-
getContentsBoundingBox
public BoundingBox getContentsBoundingBox(String table)
Get the bounding box from the contents for the table in the table's projection- Specified by:
getContentsBoundingBoxin interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- bounding box
-
getContentsBoundingBox
public BoundingBox getContentsBoundingBox(Projection projection, String table)
Get the bounding box from the contents for the table in the provided projection- Specified by:
getContentsBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projectiontable- table name- Returns:
- bounding box
-
getBoundingBox
public BoundingBox getBoundingBox(String table)
Get the bounding box for the table in the table's projection, including contents and table metadata- Specified by:
getBoundingBoxin interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- bounding box
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection, String table)
Get the bounding box for the table in the provided projection, including contents and table metadata- Specified by:
getBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projectiontable- table name- Returns:
- bounding box
-
getBoundingBox
public BoundingBox getBoundingBox(String table, boolean manual)
Get the bounding box for the table in the table's projection, including contents, table metadata, and manual queries if enabled- Specified by:
getBoundingBoxin interfaceGeoPackageCore- Parameters:
table- table namemanual- manual query flag, true to determine missing bounds manually- Returns:
- bounding box
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection, String table, boolean manual)
Get the bounding box for the table in the provided projection, including contents, table metadata, and manual queries if enabled- Specified by:
getBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projectiontable- table namemanual- manual query flag, true to determine missing bounds manually- Returns:
- bounding box
-
getTableBoundingBox
public BoundingBox getTableBoundingBox(String table)
Get the bounding box for the table in the table's projection, using only table metadata- Specified by:
getTableBoundingBoxin interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- bounding box
-
getTableBoundingBox
public BoundingBox getTableBoundingBox(Projection projection, String table)
Get the bounding box for the table in the provided projection, using only table metadata- Specified by:
getTableBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projectiontable- table name- Returns:
- bounding box
-
getTableBoundingBox
public BoundingBox getTableBoundingBox(String table, boolean manual)
Get the bounding box for the table in the table's projection, using only table metadata and manual queries if enabled- Specified by:
getTableBoundingBoxin interfaceGeoPackageCore- Parameters:
table- table namemanual- manual query flag, true to determine missing bounds manually- Returns:
- bounding box
-
getTableBoundingBox
public BoundingBox getTableBoundingBox(Projection projection, String table, boolean manual)
Get the bounding box for the table in the provided projection, using only table metadata and manual queries if enabled- Specified by:
getTableBoundingBoxin interfaceGeoPackageCore- Parameters:
projection- desired bounding box projectiontable- table namemanual- manual query flag, true to determine missing bounds manually- Returns:
- bounding box
-
getContentsProjection
public Projection getContentsProjection(String table)
Get the projection of the table contents- Specified by:
getContentsProjectionin interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- projection
-
getProjection
public Projection getProjection(String table)
Get the projection of the table- Specified by:
getProjectionin interfaceGeoPackageCore- Parameters:
table- table name- Returns:
- projection
-
getSpatialReferenceSystemDao
public SpatialReferenceSystemDao getSpatialReferenceSystemDao()
Get a Spatial Reference System DAO- Specified by:
getSpatialReferenceSystemDaoin interfaceGeoPackageCore- Returns:
- Spatial Reference System DAO
-
getContentsDao
public ContentsDao getContentsDao()
Get a Contents DAO- Specified by:
getContentsDaoin interfaceGeoPackageCore- Returns:
- Contents DAO
-
getGeometryColumnsDao
public GeometryColumnsDao getGeometryColumnsDao()
Get a Geometry Columns DAO- Specified by:
getGeometryColumnsDaoin interfaceGeoPackageCore- Returns:
- Geometry Columns DAO
-
createGeometryColumnsTable
public boolean createGeometryColumnsTable()
Create the Geometry Columns table if it does not already exist- Specified by:
createGeometryColumnsTablein interfaceGeoPackageCore- Returns:
- true if created
-
createFeatureTable
public void createFeatureTable(FeatureTable table)
Create a new feature tableWARNING: only creates the feature table, call
GeoPackageCore.createFeatureTable(FeatureTableMetadata)) instead to create both the table and required GeoPackage metadata- Specified by:
createFeatureTablein interfaceGeoPackageCore- Parameters:
table- feature table
-
createFeatureTable
public FeatureTable createFeatureTable(FeatureTableMetadata metadata)
Create a new feature table with GeoPackage metadata including: geometry columns table and row, user feature table, and contents row.- Specified by:
createFeatureTablein interfaceGeoPackageCore- Parameters:
metadata- feature table metadata- Returns:
- feature table
-
getTileMatrixSetDao
public TileMatrixSetDao getTileMatrixSetDao()
Get a Tile Matrix Set DAO- Specified by:
getTileMatrixSetDaoin interfaceGeoPackageCore- Returns:
- Tile Matrix Set DAO
-
createTileMatrixSetTable
public boolean createTileMatrixSetTable()
Create the Tile Matrix Set table if it does not already exist- Specified by:
createTileMatrixSetTablein interfaceGeoPackageCore- Returns:
- true if created
-
getTileMatrixDao
public TileMatrixDao getTileMatrixDao()
Get a Tile Matrix DAO- Specified by:
getTileMatrixDaoin interfaceGeoPackageCore- Returns:
- Tile Matrix DAO
-
createTileMatrixTable
public boolean createTileMatrixTable()
Create the Tile Matrix table if it does not already exist- Specified by:
createTileMatrixTablein interfaceGeoPackageCore- Returns:
- true if created
-
createTileTable
public void createTileTable(TileTable table)
Create a new tile tableWARNING: only creates the tile table, call
GeoPackageCore.createTileTable(TileTableMetadata)) instead to create both the table and required GeoPackage metadata- Specified by:
createTileTablein interfaceGeoPackageCore- Parameters:
table- tile table
-
createTileTable
public TileTable createTileTable(TileTableMetadata metadata)
Create a new tile table with GeoPackage metadata including: tile matrix set table and row, tile matrix table, user tile table, and contents row.- Specified by:
createTileTablein interfaceGeoPackageCore- Parameters:
metadata- tile table metadata- Returns:
- tile table
-
createAttributesTable
public void createAttributesTable(AttributesTable table)
Create a new attributes tableWARNING: only creates the attributes table, call
GeoPackageCore.createAttributesTable(AttributesTableMetadata)) instead to create both the table and required GeoPackage metadata- Specified by:
createAttributesTablein interfaceGeoPackageCore- Parameters:
table- attributes table
-
createAttributesTable
public AttributesTable createAttributesTable(AttributesTableMetadata metadata)
Create a new attributes table with GeoPackage metadata including: user attributes table and contents row.- Specified by:
createAttributesTablein interfaceGeoPackageCore- Parameters:
metadata- attributes table metadata- Returns:
- attributes table
-
getExtensionsDao
public ExtensionsDao getExtensionsDao()
Get an Extensions DAO- Specified by:
getExtensionsDaoin interfaceGeoPackageCore- Returns:
- Extensions DAO
-
createExtensionsTable
public boolean createExtensionsTable()
Create the Extensions table if it does not already exist- Specified by:
createExtensionsTablein interfaceGeoPackageCore- Returns:
- true if created
-
deleteTable
public void deleteTable(String table)
Delete the user table (a feature or tile table) and all GeoPackage metadata- Specified by:
deleteTablein interfaceGeoPackageCore- Parameters:
table- table name
-
deleteTableQuietly
public void deleteTableQuietly(String tableName)
Attempt to delete the user table (a feature or tile table) and all GeoPackage metadata quietly- Specified by:
deleteTableQuietlyin interfaceGeoPackageCore- Parameters:
tableName- table name
-
createDao
public <D extends GeoPackageDao<T,?>,T> D createDao(Class<T> type)
Create a dao- Specified by:
createDaoin interfaceGeoPackageCore- Type Parameters:
D- dao typeT- class type- Parameters:
type- dao class type- Returns:
- base dao implementation
-
endTransaction
public void endTransaction()
End a transaction successfully- Specified by:
endTransactionin interfaceGeoPackageCore
-
failTransaction
public void failTransaction()
Fail a transaction- Specified by:
failTransactionin interfaceGeoPackageCore
-
endAndBeginTransaction
public void endAndBeginTransaction()
End a transaction as successful and begin a new transaction- Specified by:
endAndBeginTransactionin interfaceGeoPackageCore
-
callInTransaction
public <T> T callInTransaction(Callable<T> callable) throws SQLException
Execute theCallableclass inside an ORMLite transaction- Specified by:
callInTransactionin interfaceGeoPackageCore- Type Parameters:
T- callable type- Parameters:
callable- Callable to execute inside of the transaction.- Returns:
- The object returned by the callable.
- Throws:
SQLException- upon transaction error
-
enableForeignKeys
public boolean enableForeignKeys()
If foreign keys is disabled and there are no foreign key violations, enables foreign key checks, else logs violations- Specified by:
enableForeignKeysin interfaceGeoPackageCore- Returns:
- true if enabled or already enabled, false if foreign key violations and not enabled
-
foreignKeys
public boolean foreignKeys()
Query for the foreign keys value- Specified by:
foreignKeysin interfaceGeoPackageCore- Returns:
- true if enabled, false if disabled
-
foreignKeys
public boolean foreignKeys(boolean on)
Change the foreign keys state- Specified by:
foreignKeysin interfaceGeoPackageCore- Parameters:
on- true to turn on, false to turn off- Returns:
- previous foreign keys value
-
verifyWritable
public void verifyWritable()
Verify the GeoPackage is writable and throw an exception if it is not- Specified by:
verifyWritablein interfaceGeoPackageCore
-
dropTable
public void dropTable(String table)
Drop the table if it exists. Drops the table with the table name, not limited to GeoPackage specific tables.- Specified by:
dropTablein interfaceGeoPackageCore- Parameters:
table- table name
-
dropView
public void dropView(String view)
Drop the view if it exists. Drops the view with the view name, not limited to GeoPackage specific tables.- Specified by:
dropViewin interfaceGeoPackageCore- Parameters:
view- view name
-
renameTable
public void renameTable(String tableName, String newTableName)
Rename the table- Specified by:
renameTablein interfaceGeoPackageCore- Parameters:
tableName- table namenewTableName- new table name
-
copyTable
public void copyTable(String tableName, String newTableName)
Copy the table with transferred contents and extensions- Specified by:
copyTablein interfaceGeoPackageCore- Parameters:
tableName- table namenewTableName- new table name
-
copyTableNoExtensions
public void copyTableNoExtensions(String tableName, String newTableName)
Copy the table with transferred contents but no extensions- Specified by:
copyTableNoExtensionsin interfaceGeoPackageCore- Parameters:
tableName- table namenewTableName- new table name
-
copyTableAsEmpty
public void copyTableAsEmpty(String tableName, String newTableName)
Copy the table but leave the user table empty and without extensions- Specified by:
copyTableAsEmptyin interfaceGeoPackageCore- Parameters:
tableName- table namenewTableName- new table name
-
copyTable
protected void copyTable(String tableName, String newTableName, boolean transferContent, boolean extensions)
Copy the table- Parameters:
tableName- table namenewTableName- new table nametransferContent- transfer content flagextensions- extensions copy flag
-
copyAttributeTable
protected void copyAttributeTable(String tableName, String newTableName, boolean transferContent)
Copy the attribute table- Parameters:
tableName- table namenewTableName- new table nametransferContent- transfer content flag- Since:
- 3.3.0
-
copyFeatureTable
protected void copyFeatureTable(String tableName, String newTableName, boolean transferContent)
Copy the feature table- Parameters:
tableName- table namenewTableName- new table nametransferContent- transfer content flag- Since:
- 3.3.0
-
copyTileTable
protected void copyTileTable(String tableName, String newTableName, boolean transferContent)
Copy the tile table- Parameters:
tableName- table namenewTableName- new table nametransferContent- transfer content flag- Since:
- 3.3.0
-
copyUserTable
protected Contents copyUserTable(String tableName, String newTableName, boolean transferContent)
Copy the user table- Parameters:
tableName- table namenewTableName- new table nametransferContent- transfer user table content flag- Returns:
- copied contents
- Since:
- 3.3.0
-
copyUserTable
protected Contents copyUserTable(String tableName, String newTableName, boolean transferContent, boolean validateContents)
Copy the user table- Parameters:
tableName- table namenewTableName- new table nametransferContent- transfer user table content flagvalidateContents- true to validate a contents was copied- Returns:
- copied contents
- Since:
- 3.3.0
-
copyContents
protected Contents copyContents(String tableName, String newTableName)
Copy the contents- Parameters:
tableName- table namenewTableName- new table name- Returns:
- copied contents
- Since:
- 3.3.0
-
vacuum
public void vacuum()
Rebuild the GeoPackage, repacking it into a minimal amount of disk space- Specified by:
vacuumin interfaceGeoPackageCore
-
getExtensionManager
public ExtensionManager getExtensionManager()
Get an extension manager on the GeoPackage- Specified by:
getExtensionManagerin interfaceGeoPackageCore- Returns:
- extension manager
-
createUserTable
public void createUserTable(UserTable<? extends UserColumn> table)
Create a new user table- Specified by:
createUserTablein interfaceGeoPackageCore- Parameters:
table- user table
-
saveSchema
public void saveSchema(UserTable<? extends UserColumn> table)
Save the table schema using theSchemaExtension- Specified by:
saveSchemain interfaceGeoPackageCore- Parameters:
table- user table
-
-