public abstract class GeoPackageCoreImpl extends Object implements GeoPackageCore
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
writable
Writable GeoPackage flag
|
| Modifier | Constructor and Description |
|---|---|
protected |
GeoPackageCoreImpl(String name,
String path,
GeoPackageCoreConnection database)
Constructor
|
protected |
GeoPackageCoreImpl(String name,
String path,
GeoPackageCoreConnection database,
boolean writable)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
callInTransaction(Callable<T> callable)
Execute the
Callable class inside an ORMLite transaction |
void |
close()
Close the GeoPackage connection
|
protected void |
copyAttributeTable(String tableName,
String newTableName,
boolean transferContent)
Copy the attribute table
|
protected Contents |
copyContents(String tableName,
String newTableName)
Copy the contents
|
protected void |
copyFeatureTable(String tableName,
String newTableName,
boolean transferContent)
Copy the feature table
|
void |
copyTable(String tableName,
String newTableName)
Copy the table with transferred contents and extensions
|
protected void |
copyTable(String tableName,
String newTableName,
boolean transferContent,
boolean extensions)
Copy the table
|
void |
copyTableAsEmpty(String tableName,
String newTableName)
Copy the table but leave the user table empty and without extensions
|
void |
copyTableNoExtensions(String tableName,
String newTableName)
Copy the table with transferred contents but no extensions
|
protected void |
copyTileTable(String tableName,
String newTableName,
boolean transferContent)
Copy the tile table
|
protected Contents |
copyUserTable(String tableName,
String newTableName,
boolean transferContent)
Copy the user table
|
protected Contents |
copyUserTable(String tableName,
String newTableName,
boolean transferContent,
boolean validateContents)
Copy the user table
|
void |
createAttributesTable(AttributesTable table)
Create a new attributes table
WARNING: only creates the attributes table, call
GeoPackageCore.createAttributesTable(AttributesTableMetadata)) instead to
create both the table and required GeoPackage metadata |
AttributesTable |
createAttributesTable(AttributesTableMetadata metadata)
Create a new attributes table with GeoPackage metadata including: user
attributes table and contents row.
|
<D extends GeoPackageDao<T,?>,T> |
createDao(Class<T> type)
Create a dao
|
boolean |
createExtensionsTable()
Create the Extensions table if it does not already exist
|
void |
createFeatureTable(FeatureTable table)
Create a new feature table
WARNING: only creates the feature table, call
GeoPackageCore.createFeatureTable(FeatureTableMetadata)) instead to create both
the table and required GeoPackage metadata |
FeatureTable |
createFeatureTable(FeatureTableMetadata metadata)
Create a new feature table with GeoPackage metadata including: geometry
columns table and row, user feature table, and contents row.
|
boolean |
createGeometryColumnsTable()
Create the Geometry Columns table if it does not already exist
|
boolean |
createTileMatrixSetTable()
Create the Tile Matrix Set table if it does not already exist
|
boolean |
createTileMatrixTable()
Create the Tile Matrix table if it does not already exist
|
void |
createTileTable(TileTable table)
Create a new tile table
WARNING: only creates the tile table, call
GeoPackageCore.createTileTable(TileTableMetadata)) instead to create both the
table and required GeoPackage metadata |
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.
|
void |
createUserTable(UserTable<? extends UserColumn> table)
Create a new user table
|
void |
deleteTable(String table)
Delete the user table (a feature or tile table) and all GeoPackage
metadata
|
void |
deleteTableQuietly(String tableName)
Attempt to delete the user table (a feature or tile table) and all
GeoPackage metadata quietly
|
void |
dropTable(String table)
Drop the table if it exists.
|
void |
dropView(String view)
Drop the view if it exists.
|
boolean |
enableForeignKeys()
If foreign keys is disabled and there are no foreign key violations,
enables foreign key checks, else logs violations
|
void |
endAndBeginTransaction()
End a transaction as successful and begin a new transaction
|
void |
endTransaction()
End a transaction successfully
|
void |
failTransaction()
Fail a transaction
|
boolean |
foreignKeys()
Query for the foreign keys value
|
boolean |
foreignKeys(boolean on)
Change the foreign keys state
|
String |
getApplicationId()
Get the application id
|
String |
getApplicationIdHex()
Get the application id as a hex string prefixed with 0x
|
Integer |
getApplicationIdInteger()
Get the application id integer
|
List<String> |
getAttributesTables()
Get the attributes tables
|
BoundingBox |
getBoundingBox(Projection projection)
Get the bounding box for all tables in the provided projection, including
contents and table metadata
|
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
|
BoundingBox |
getBoundingBox(Projection projection,
String table)
Get the bounding box for the table in the provided projection, including
contents and table metadata
|
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
|
BoundingBox |
getBoundingBox(String table)
Get the bounding box for the table in the table's projection, including
contents and table metadata
|
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
|
BoundingBox |
getContentsBoundingBox(Projection projection)
Get the bounding box for all table contents in the provided projection
|
BoundingBox |
getContentsBoundingBox(Projection projection,
String table)
Get the bounding box from the contents for the table in the provided
projection
|
BoundingBox |
getContentsBoundingBox(String table)
Get the bounding box from the contents for the table in the table's
projection
|
ContentsDao |
getContentsDao()
Get a Contents DAO
|
Projection |
getContentsProjection(String table)
Get the projection of the table contents
|
GeoPackageCoreConnection |
getDatabase()
Get the SQLite database
|
ExtensionManager |
getExtensionManager()
Get an extension manager on the GeoPackage
|
ExtensionsDao |
getExtensionsDao()
Get an Extensions DAO
|
List<String> |
getFeatureTables()
Get the feature tables
|
GeometryColumnsDao |
getGeometryColumnsDao()
Get a Geometry Columns DAO
|
String |
getName()
Get the GeoPackage name
|
String |
getPath()
Get the GeoPackage path
|
Projection |
getProjection(String table)
Get the projection of the table
|
SpatialReferenceSystemDao |
getSpatialReferenceSystemDao()
Get a Spatial Reference System DAO
|
BoundingBox |
getTableBoundingBox(Projection projection)
Get the bounding box for all tables in the provided projection, using
only table metadata
|
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
|
BoundingBox |
getTableBoundingBox(Projection projection,
String table)
Get the bounding box for the table in the provided projection, using only
table metadata
|
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
|
BoundingBox |
getTableBoundingBox(String table)
Get the bounding box for the table in the table's projection, using only
table metadata
|
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
|
Contents |
getTableContents(String table)
Get the contents of the user table
|
GeoPackageTableCreator |
getTableCreator()
Get the Table Creator
|
ContentsDataType |
getTableDataType(String table)
Get the contents data type of the user table
|
List<String> |
getTables()
Get all tables
|
List<String> |
getTables(ContentsDataType... types)
Get the tables for the contents data types
|
List<String> |
getTables(ContentsDataType type)
Get the tables for the contents data type
|
List<String> |
getTables(String... types)
Get the tables for the contents data types
|
List<String> |
getTables(String type)
Get the tables for the contents data type
|
String |
getTableType(String table)
Get the contents data type of the user table
|
TileMatrixDao |
getTileMatrixDao()
Get a Tile Matrix DAO
|
TileMatrixSetDao |
getTileMatrixSetDao()
Get a Tile Matrix Set DAO
|
List<String> |
getTileTables()
Get the tile tables
|
List<Contents> |
getTypeContents(ContentsDataType... types)
Get the contents for the data types
|
List<Contents> |
getTypeContents(ContentsDataType type)
Get the contents for the data type
|
List<Contents> |
getTypeContents(String... types)
Get the contents for the data types
|
List<Contents> |
getTypeContents(String type)
Get the contents for the data type
|
Integer |
getUserVersion()
Get the user version
|
Integer |
getUserVersionMajor()
Get the major user version
|
Integer |
getUserVersionMinor()
Get the minor user version
|
Integer |
getUserVersionPatch()
Get the patch user version
|
boolean |
isAttributeTable(String table)
Check if the table is an attribute table
|
boolean |
isContentsTable(String table)
Check if the table exists as a user contents table
|
boolean |
isFeatureTable(String table)
Check if the table is a feature table
|
boolean |
isTable(String table)
Check if the table exists
|
boolean |
isTableOrView(String name)
Check if the table or view exists
|
boolean |
isTableType(String table,
ContentsDataType... types)
Check if the table is one of the provided types
|
boolean |
isTableType(String table,
ContentsDataType type)
Check if the table is the provided type
|
boolean |
isTableType(String table,
String... types)
Check if the table is one of the provided types
|
boolean |
isTableType(String table,
String type)
Check if the table is the provided type
|
boolean |
isTileTable(String table)
Check if the table is a tile table
|
boolean |
isView(String view)
Check if the view exists
|
boolean |
isWritable()
Is the GeoPackage writable
|
void |
renameTable(String tableName,
String newTableName)
Rename the table
|
void |
vacuum()
Rebuild the GeoPackage, repacking it into a minimal amount of disk space
|
void |
verifyWritable()
Verify the GeoPackage is writable and throw an exception if it is not
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbeginTransaction, commit, endTransaction, execSQL, getFeatureBoundingBox, inTransactionprotected GeoPackageCoreImpl(String name, String path, GeoPackageCoreConnection database)
name - namepath - pathdatabase - databaseprotected GeoPackageCoreImpl(String name, String path, GeoPackageCoreConnection database, boolean writable)
name - namepath - pathdatabase - databasewritable - true if writablepublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface GeoPackageCorepublic String getName()
getName in interface GeoPackageCorepublic String getPath()
getPath in interface GeoPackageCorepublic GeoPackageCoreConnection getDatabase()
getDatabase in interface GeoPackageCorepublic GeoPackageTableCreator getTableCreator()
getTableCreator in interface GeoPackageCorepublic boolean isWritable()
isWritable in interface GeoPackageCorepublic String getApplicationId()
getApplicationId in interface GeoPackageCorepublic Integer getApplicationIdInteger()
getApplicationIdInteger in interface GeoPackageCorepublic String getApplicationIdHex()
getApplicationIdHex in interface GeoPackageCorepublic Integer getUserVersion()
getUserVersion in interface GeoPackageCorepublic Integer getUserVersionMajor()
getUserVersionMajor in interface GeoPackageCorepublic Integer getUserVersionMinor()
getUserVersionMinor in interface GeoPackageCorepublic Integer getUserVersionPatch()
getUserVersionPatch in interface GeoPackageCorepublic List<String> getFeatureTables()
getFeatureTables in interface GeoPackageCorepublic List<String> getTileTables()
getTileTables in interface GeoPackageCorepublic List<String> getAttributesTables()
getAttributesTables in interface GeoPackageCorepublic List<String> getTables(ContentsDataType type)
getTables in interface GeoPackageCoretype - data typepublic List<String> getTables(ContentsDataType... types)
getTables in interface GeoPackageCoretypes - data typespublic List<String> getTables(String type)
getTables in interface GeoPackageCoretype - data typepublic List<String> getTables(String... types)
getTables in interface GeoPackageCoretypes - data typespublic List<Contents> getTypeContents(ContentsDataType type)
getTypeContents in interface GeoPackageCoretype - data typepublic List<Contents> getTypeContents(ContentsDataType... types)
getTypeContents in interface GeoPackageCoretypes - data typespublic List<Contents> getTypeContents(String type)
getTypeContents in interface GeoPackageCoretype - data typepublic List<Contents> getTypeContents(String... types)
getTypeContents in interface GeoPackageCoretypes - data typespublic List<String> getTables()
getTables in interface GeoPackageCorepublic boolean isFeatureTable(String table)
isFeatureTable in interface GeoPackageCoretable - table namepublic boolean isTileTable(String table)
isTileTable in interface GeoPackageCoretable - table namepublic boolean isAttributeTable(String table)
isAttributeTable in interface GeoPackageCoretable - table namepublic boolean isTableType(String table, ContentsDataType type)
isTableType in interface GeoPackageCoretable - table nametype - data typepublic boolean isTableType(String table, ContentsDataType... types)
isTableType in interface GeoPackageCoretable - table nametypes - data typespublic boolean isTableType(String table, String type)
isTableType in interface GeoPackageCoretable - table nametype - data typepublic boolean isTableType(String table, String... types)
isTableType in interface GeoPackageCoretable - table nametypes - data typespublic boolean isContentsTable(String table)
isContentsTable in interface GeoPackageCoretable - table namepublic boolean isTable(String table)
isTable in interface GeoPackageCoretable - table namepublic boolean isView(String view)
isView in interface GeoPackageCoreview - view namepublic boolean isTableOrView(String name)
isTableOrView in interface GeoPackageCorename - table or view namepublic Contents getTableContents(String table)
getTableContents in interface GeoPackageCoretable - table namepublic String getTableType(String table)
getTableType in interface GeoPackageCoretable - table namepublic ContentsDataType getTableDataType(String table)
getTableDataType in interface GeoPackageCoretable - table namepublic BoundingBox getContentsBoundingBox(Projection projection)
getContentsBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectionpublic BoundingBox getBoundingBox(Projection projection)
getBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectionpublic BoundingBox getBoundingBox(Projection projection, boolean manual)
getBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectionmanual - manual query flag, true to determine missing bounds manuallypublic BoundingBox getTableBoundingBox(Projection projection)
getTableBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectionpublic BoundingBox getTableBoundingBox(Projection projection, boolean manual)
getTableBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectionmanual - manual query flag, true to determine missing bounds manuallypublic BoundingBox getContentsBoundingBox(String table)
getContentsBoundingBox in interface GeoPackageCoretable - table namepublic BoundingBox getContentsBoundingBox(Projection projection, String table)
getContentsBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectiontable - table namepublic BoundingBox getBoundingBox(String table)
getBoundingBox in interface GeoPackageCoretable - table namepublic BoundingBox getBoundingBox(Projection projection, String table)
getBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectiontable - table namepublic BoundingBox getBoundingBox(String table, boolean manual)
getBoundingBox in interface GeoPackageCoretable - table namemanual - manual query flag, true to determine missing bounds manuallypublic BoundingBox getBoundingBox(Projection projection, String table, boolean manual)
getBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectiontable - table namemanual - manual query flag, true to determine missing bounds manuallypublic BoundingBox getTableBoundingBox(String table)
getTableBoundingBox in interface GeoPackageCoretable - table namepublic BoundingBox getTableBoundingBox(Projection projection, String table)
getTableBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectiontable - table namepublic BoundingBox getTableBoundingBox(String table, boolean manual)
getTableBoundingBox in interface GeoPackageCoretable - table namemanual - manual query flag, true to determine missing bounds manuallypublic BoundingBox getTableBoundingBox(Projection projection, String table, boolean manual)
getTableBoundingBox in interface GeoPackageCoreprojection - desired bounding box projectiontable - table namemanual - manual query flag, true to determine missing bounds manuallypublic Projection getContentsProjection(String table)
getContentsProjection in interface GeoPackageCoretable - table namepublic Projection getProjection(String table)
getProjection in interface GeoPackageCoretable - table namepublic SpatialReferenceSystemDao getSpatialReferenceSystemDao()
getSpatialReferenceSystemDao in interface GeoPackageCorepublic ContentsDao getContentsDao()
getContentsDao in interface GeoPackageCorepublic GeometryColumnsDao getGeometryColumnsDao()
getGeometryColumnsDao in interface GeoPackageCorepublic boolean createGeometryColumnsTable()
createGeometryColumnsTable in interface GeoPackageCorepublic void createFeatureTable(FeatureTable table)
GeoPackageCore.createFeatureTable(FeatureTableMetadata)) instead to create both
the table and required GeoPackage metadatacreateFeatureTable in interface GeoPackageCoretable - feature tablepublic FeatureTable createFeatureTable(FeatureTableMetadata metadata)
createFeatureTable in interface GeoPackageCoremetadata - feature table metadatapublic TileMatrixSetDao getTileMatrixSetDao()
getTileMatrixSetDao in interface GeoPackageCorepublic boolean createTileMatrixSetTable()
createTileMatrixSetTable in interface GeoPackageCorepublic TileMatrixDao getTileMatrixDao()
getTileMatrixDao in interface GeoPackageCorepublic boolean createTileMatrixTable()
createTileMatrixTable in interface GeoPackageCorepublic void createTileTable(TileTable table)
GeoPackageCore.createTileTable(TileTableMetadata)) instead to create both the
table and required GeoPackage metadatacreateTileTable in interface GeoPackageCoretable - tile tablepublic TileTable createTileTable(TileTableMetadata metadata)
createTileTable in interface GeoPackageCoremetadata - tile table metadatapublic void createAttributesTable(AttributesTable table)
GeoPackageCore.createAttributesTable(AttributesTableMetadata)) instead to
create both the table and required GeoPackage metadatacreateAttributesTable in interface GeoPackageCoretable - attributes tablepublic AttributesTable createAttributesTable(AttributesTableMetadata metadata)
createAttributesTable in interface GeoPackageCoremetadata - attributes table metadatapublic ExtensionsDao getExtensionsDao()
getExtensionsDao in interface GeoPackageCorepublic boolean createExtensionsTable()
createExtensionsTable in interface GeoPackageCorepublic void deleteTable(String table)
deleteTable in interface GeoPackageCoretable - table namepublic void deleteTableQuietly(String tableName)
deleteTableQuietly in interface GeoPackageCoretableName - table namepublic <D extends GeoPackageDao<T,?>,T> D createDao(Class<T> type)
createDao in interface GeoPackageCoreD - dao typeT - class typetype - dao class typepublic void endTransaction()
endTransaction in interface GeoPackageCorepublic void failTransaction()
failTransaction in interface GeoPackageCorepublic void endAndBeginTransaction()
endAndBeginTransaction in interface GeoPackageCorepublic <T> T callInTransaction(Callable<T> callable) throws SQLException
Callable class inside an ORMLite transactioncallInTransaction in interface GeoPackageCoreT - callable typecallable - Callable to execute inside of the transaction.SQLException - upon transaction errorpublic boolean enableForeignKeys()
enableForeignKeys in interface GeoPackageCorepublic boolean foreignKeys()
foreignKeys in interface GeoPackageCorepublic boolean foreignKeys(boolean on)
foreignKeys in interface GeoPackageCoreon - true to turn on, false to turn offpublic void verifyWritable()
verifyWritable in interface GeoPackageCorepublic void dropTable(String table)
dropTable in interface GeoPackageCoretable - table namepublic void dropView(String view)
dropView in interface GeoPackageCoreview - view namepublic void renameTable(String tableName, String newTableName)
renameTable in interface GeoPackageCoretableName - table namenewTableName - new table namepublic void copyTable(String tableName, String newTableName)
copyTable in interface GeoPackageCoretableName - table namenewTableName - new table namepublic void copyTableNoExtensions(String tableName, String newTableName)
copyTableNoExtensions in interface GeoPackageCoretableName - table namenewTableName - new table namepublic void copyTableAsEmpty(String tableName, String newTableName)
copyTableAsEmpty in interface GeoPackageCoretableName - table namenewTableName - new table nameprotected void copyTable(String tableName, String newTableName, boolean transferContent, boolean extensions)
tableName - table namenewTableName - new table nametransferContent - transfer content flagextensions - extensions copy flagprotected void copyAttributeTable(String tableName, String newTableName, boolean transferContent)
tableName - table namenewTableName - new table nametransferContent - transfer content flagprotected void copyFeatureTable(String tableName, String newTableName, boolean transferContent)
tableName - table namenewTableName - new table nametransferContent - transfer content flagprotected void copyTileTable(String tableName, String newTableName, boolean transferContent)
tableName - table namenewTableName - new table nametransferContent - transfer content flagprotected Contents copyUserTable(String tableName, String newTableName, boolean transferContent)
tableName - table namenewTableName - new table nametransferContent - transfer user table content flagprotected Contents copyUserTable(String tableName, String newTableName, boolean transferContent, boolean validateContents)
tableName - table namenewTableName - new table nametransferContent - transfer user table content flagvalidateContents - true to validate a contents was copiedprotected Contents copyContents(String tableName, String newTableName)
tableName - table namenewTableName - new table namepublic void vacuum()
vacuum in interface GeoPackageCorepublic ExtensionManager getExtensionManager()
getExtensionManager in interface GeoPackageCorepublic void createUserTable(UserTable<? extends UserColumn> table)
createUserTable in interface GeoPackageCoretable - user tableCopyright © 2021 National Geospatial-Intelligence Agency. All rights reserved.