Interface GeoPackageCore

    • Method Detail

      • getName

        String getName()
        Get the GeoPackage name
        Returns:
        name
      • getPath

        String getPath()
        Get the GeoPackage path
        Returns:
        path
      • getTableCreator

        GeoPackageTableCreator getTableCreator()
        Get the Table Creator
        Returns:
        table creator
        Since:
        4.0.0
      • isWritable

        boolean isWritable()
        Is the GeoPackage writable
        Returns:
        true if writable
      • getApplicationId

        String getApplicationId()
        Get the application id
        Returns:
        application id
        Since:
        1.2.1
      • getApplicationIdInteger

        Integer getApplicationIdInteger()
        Get the application id integer
        Returns:
        application id integer
        Since:
        4.0.0
      • getApplicationIdHex

        String getApplicationIdHex()
        Get the application id as a hex string prefixed with 0x
        Returns:
        application id hex string
        Since:
        4.0.0
      • getUserVersion

        Integer getUserVersion()
        Get the user version
        Returns:
        user version
        Since:
        1.2.1
      • getUserVersionMajor

        Integer getUserVersionMajor()
        Get the major user version
        Returns:
        major user version
        Since:
        1.2.1
      • getUserVersionMinor

        Integer getUserVersionMinor()
        Get the minor user version
        Returns:
        minor user version
        Since:
        1.2.1
      • getUserVersionPatch

        Integer getUserVersionPatch()
        Get the patch user version
        Returns:
        patch user version
        Since:
        1.2.1
      • getFeatureTables

        List<String> getFeatureTables()
        Get the feature tables
        Returns:
        table names
      • getTileTables

        List<String> getTileTables()
        Get the tile tables
        Returns:
        table names
      • getAttributesTables

        List<String> getAttributesTables()
        Get the attributes tables
        Returns:
        table name
        Since:
        1.2.1
      • getTables

        List<String> getTables​(ContentsDataType type)
        Get the tables for the contents data type
        Parameters:
        type - data type
        Returns:
        table names
        Since:
        1.2.1
      • getTables

        List<String> getTables​(ContentsDataType... types)
        Get the tables for the contents data types
        Parameters:
        types - data types
        Returns:
        table names
        Since:
        4.0.0
      • getTables

        List<String> getTables​(String type)
        Get the tables for the contents data type
        Parameters:
        type - data type
        Returns:
        table names
        Since:
        3.0.1
      • getTables

        List<String> getTables​(String... types)
        Get the tables for the contents data types
        Parameters:
        types - data types
        Returns:
        table names
        Since:
        4.0.0
      • getTypeContents

        List<Contents> getTypeContents​(ContentsDataType type)
        Get the contents for the data type
        Parameters:
        type - data type
        Returns:
        contents
        Since:
        4.0.0
      • getTypeContents

        List<Contents> getTypeContents​(ContentsDataType... types)
        Get the contents for the data types
        Parameters:
        types - data types
        Returns:
        contents
        Since:
        4.0.0
      • getTypeContents

        List<Contents> getTypeContents​(String type)
        Get the contents for the data type
        Parameters:
        type - data type
        Returns:
        contents
        Since:
        3.0.1
      • getTypeContents

        List<Contents> getTypeContents​(String... types)
        Get the contents for the data types
        Parameters:
        types - data types
        Returns:
        contents
        Since:
        4.0.0
      • getTables

        List<String> getTables()
        Get all tables
        Returns:
        table names
        Since:
        1.1.7
      • isFeatureTable

        boolean isFeatureTable​(String table)
        Check if the table is a feature table
        Parameters:
        table - table name
        Returns:
        true if a feature table
        Since:
        1.1.7
      • isTileTable

        boolean isTileTable​(String table)
        Check if the table is a tile table
        Parameters:
        table - table name
        Returns:
        true if a tile table
        Since:
        1.1.7
      • isAttributeTable

        boolean isAttributeTable​(String table)
        Check if the table is an attribute table
        Parameters:
        table - table name
        Returns:
        true if an attribute table
        Since:
        3.3.0
      • isTableType

        boolean isTableType​(String table,
                            ContentsDataType type)
        Check if the table is the provided type
        Parameters:
        table - table name
        type - data type
        Returns:
        true if the type of table
        Since:
        4.0.0
      • isTableType

        boolean isTableType​(String table,
                            ContentsDataType... types)
        Check if the table is one of the provided types
        Parameters:
        table - table name
        types - data types
        Returns:
        true if the type of table
        Since:
        4.0.0
      • isTableType

        boolean isTableType​(String table,
                            String type)
        Check if the table is the provided type
        Parameters:
        table - table name
        type - data type
        Returns:
        true if the type of table
        Since:
        4.0.0
      • isTableType

        boolean isTableType​(String table,
                            String... types)
        Check if the table is one of the provided types
        Parameters:
        table - table name
        types - data types
        Returns:
        true if the type of table
        Since:
        4.0.0
      • isContentsTable

        boolean isContentsTable​(String table)
        Check if the table exists as a user contents table
        Parameters:
        table - table name
        Returns:
        true if a user contents table
        Since:
        3.2.0
      • isTable

        boolean isTable​(String table)
        Check if the table exists
        Parameters:
        table - table name
        Returns:
        true if a table
        Since:
        1.2.1
      • isView

        boolean isView​(String view)
        Check if the view exists
        Parameters:
        view - view name
        Returns:
        true if a view
        Since:
        4.0.0
      • isTableOrView

        boolean isTableOrView​(String name)
        Check if the table or view exists
        Parameters:
        name - table or view name
        Returns:
        true if a table or view
        Since:
        4.0.0
      • getTableContents

        Contents getTableContents​(String table)
        Get the contents of the user table
        Parameters:
        table - table name
        Returns:
        contents
        Since:
        3.0.1
      • getTableType

        String getTableType​(String table)
        Get the contents data type of the user table
        Parameters:
        table - table name
        Returns:
        table type
        Since:
        3.0.1
      • getTableDataType

        ContentsDataType getTableDataType​(String table)
        Get the contents data type of the user table
        Parameters:
        table - table name
        Returns:
        table type or null if not an enumerated type
        Since:
        3.3.0
      • getTableCoreDataType

        ContentsDataType getTableCoreDataType​(String table)
        Get the data type of the user table only if it is a core data type (features, tiles, attributes)
        Parameters:
        table - table name
        Returns:
        core data type or null
        Since:
        6.6.4
      • isTableCoreDataType

        boolean isTableCoreDataType​(String table)
        Determine if the user table is one of the core data types (features, tiles, attributes)
        Parameters:
        table - table name
        Returns:
        true if a core data type
        Since:
        6.6.4
      • getContentsBoundingBox

        BoundingBox getContentsBoundingBox​(Projection projection)
        Get the bounding box for all table contents in the provided projection
        Parameters:
        projection - desired bounding box projection
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        BoundingBox getBoundingBox​(Projection projection)
        Get the bounding box for all tables in the provided projection, including contents and table metadata
        Parameters:
        projection - desired bounding box projection
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        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
        Parameters:
        projection - desired bounding box projection
        manual - manual query flag, true to determine missing bounds manually
        Returns:
        bounding box
        Since:
        3.1.0
      • getTableBoundingBox

        BoundingBox getTableBoundingBox​(Projection projection)
        Get the bounding box for all tables in the provided projection, using only table metadata
        Parameters:
        projection - desired bounding box projection
        Returns:
        bounding box
        Since:
        4.0.0
      • getTableBoundingBox

        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
        Parameters:
        projection - desired bounding box projection
        manual - manual query flag, true to determine missing bounds manually
        Returns:
        bounding box
        Since:
        4.0.0
      • getContentsBoundingBox

        BoundingBox getContentsBoundingBox​(String table)
        Get the bounding box from the contents for the table in the table's projection
        Parameters:
        table - table name
        Returns:
        bounding box
        Since:
        3.1.0
      • getContentsBoundingBox

        BoundingBox getContentsBoundingBox​(Projection projection,
                                           String table)
        Get the bounding box from the contents for the table in the provided projection
        Parameters:
        projection - desired bounding box projection
        table - table name
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        BoundingBox getBoundingBox​(String table)
        Get the bounding box for the table in the table's projection, including contents and table metadata
        Parameters:
        table - table name
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        BoundingBox getBoundingBox​(Projection projection,
                                   String table)
        Get the bounding box for the table in the provided projection, including contents and table metadata
        Parameters:
        projection - desired bounding box projection
        table - table name
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        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
        Parameters:
        table - table name
        manual - manual query flag, true to determine missing bounds manually
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        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
        Parameters:
        projection - desired bounding box projection
        table - table name
        manual - manual query flag, true to determine missing bounds manually
        Returns:
        bounding box
        Since:
        3.1.0
      • getTableBoundingBox

        BoundingBox getTableBoundingBox​(String table)
        Get the bounding box for the table in the table's projection, using only table metadata
        Parameters:
        table - table name
        Returns:
        bounding box
        Since:
        4.0.0
      • getTableBoundingBox

        BoundingBox getTableBoundingBox​(Projection projection,
                                        String table)
        Get the bounding box for the table in the provided projection, using only table metadata
        Parameters:
        projection - desired bounding box projection
        table - table name
        Returns:
        bounding box
        Since:
        4.0.0
      • getTableBoundingBox

        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
        Parameters:
        table - table name
        manual - manual query flag, true to determine missing bounds manually
        Returns:
        bounding box
        Since:
        4.0.0
      • getTableBoundingBox

        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
        Parameters:
        projection - desired bounding box projection
        table - table name
        manual - manual query flag, true to determine missing bounds manually
        Returns:
        bounding box
        Since:
        4.0.0
      • getContentsProjection

        Projection getContentsProjection​(String table)
        Get the projection of the table contents
        Parameters:
        table - table name
        Returns:
        projection
        Since:
        4.0.0
      • getProjection

        Projection getProjection​(String table)
        Get the projection of the table
        Parameters:
        table - table name
        Returns:
        projection
        Since:
        4.0.0
      • getFeatureBoundingBox

        BoundingBox getFeatureBoundingBox​(Projection projection,
                                          String table,
                                          boolean manual)
        Get the feature table bounding box
        Parameters:
        projection - desired projection
        table - table name
        manual - true to manually query if not indexed
        Returns:
        bounding box
        Since:
        3.5.0
      • getSpatialReferenceSystemDao

        SpatialReferenceSystemDao getSpatialReferenceSystemDao()
        Get a Spatial Reference System DAO
        Returns:
        Spatial Reference System DAO
      • getContentsDao

        ContentsDao getContentsDao()
        Get a Contents DAO
        Returns:
        Contents DAO
      • getGeometryColumnsDao

        GeometryColumnsDao getGeometryColumnsDao()
        Get a Geometry Columns DAO
        Returns:
        Geometry Columns DAO
      • createGeometryColumnsTable

        boolean createGeometryColumnsTable()
        Create the Geometry Columns table if it does not already exist
        Returns:
        true if created
      • createFeatureTable

        void createFeatureTable​(FeatureTable table)
        Create a new feature table

        WARNING: only creates the feature table, call createFeatureTable(FeatureTableMetadata)) instead to create both the table and required GeoPackage metadata

        Parameters:
        table - feature table
      • createFeatureTable

        FeatureTable createFeatureTable​(FeatureTableMetadata metadata)
        Create a new feature table with GeoPackage metadata including: geometry columns table and row, user feature table, and contents row.
        Parameters:
        metadata - feature table metadata
        Returns:
        feature table
        Since:
        4.0.0
      • getTileMatrixSetDao

        TileMatrixSetDao getTileMatrixSetDao()
        Get a Tile Matrix Set DAO
        Returns:
        Tile Matrix Set DAO
      • createTileMatrixSetTable

        boolean createTileMatrixSetTable()
        Create the Tile Matrix Set table if it does not already exist
        Returns:
        true if created
      • getTileMatrixDao

        TileMatrixDao getTileMatrixDao()
        Get a Tile Matrix DAO
        Returns:
        Tile Matrix DAO
      • createTileMatrixTable

        boolean createTileMatrixTable()
        Create the Tile Matrix table if it does not already exist
        Returns:
        true if created
      • createTileTable

        void createTileTable​(TileTable table)
        Create a new tile table

        WARNING: only creates the tile table, call createTileTable(TileTableMetadata)) instead to create both the table and required GeoPackage metadata

        Parameters:
        table - tile table
      • createTileTable

        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.
        Parameters:
        metadata - tile table metadata
        Returns:
        tile table
        Since:
        4.0.0
      • createAttributesTable

        void createAttributesTable​(AttributesTable table)
        Create a new attributes table

        WARNING: only creates the attributes table, call createAttributesTable(AttributesTableMetadata)) instead to create both the table and required GeoPackage metadata

        Parameters:
        table - attributes table
        Since:
        1.2.1
      • createAttributesTable

        AttributesTable createAttributesTable​(AttributesTableMetadata metadata)
        Create a new attributes table with GeoPackage metadata including: user attributes table and contents row.
        Parameters:
        metadata - attributes table metadata
        Returns:
        attributes table
        Since:
        4.0.0
      • getExtensionsDao

        ExtensionsDao getExtensionsDao()
        Get an Extensions DAO
        Returns:
        Extensions DAO
      • createExtensionsTable

        boolean createExtensionsTable()
        Create the Extensions table if it does not already exist
        Returns:
        true if created
      • deleteTable

        void deleteTable​(String table)
        Delete the user table (a feature or tile table) and all GeoPackage metadata
        Parameters:
        table - table name
      • deleteTableQuietly

        void deleteTableQuietly​(String tableName)
        Attempt to delete the user table (a feature or tile table) and all GeoPackage metadata quietly
        Parameters:
        tableName - table name
      • verifyWritable

        void verifyWritable()
        Verify the GeoPackage is writable and throw an exception if it is not
      • createDao

        <D extends GeoPackageDao<T,​?>,​T> D createDao​(Class<T> type)
        Create a dao
        Type Parameters:
        D - dao type
        T - class type
        Parameters:
        type - dao class type
        Returns:
        base dao implementation
        Since:
        1.1.0
      • execSQL

        void execSQL​(String sql)
        Execute the sql on the GeoPackage database
        Parameters:
        sql - sql statement
        Since:
        1.1.2
      • beginTransaction

        void beginTransaction()
        Begin a transaction
        Since:
        3.3.0
      • endTransaction

        void endTransaction()
        End a transaction successfully
        Since:
        3.3.0
      • failTransaction

        void failTransaction()
        Fail a transaction
        Since:
        3.3.0
      • endTransaction

        void endTransaction​(boolean successful)
        End a transaction
        Parameters:
        successful - true if the transaction was successful, false to rollback or not commit
        Since:
        3.3.0
      • endAndBeginTransaction

        void endAndBeginTransaction()
        End a transaction as successful and begin a new transaction
        Since:
        3.3.0
      • commit

        void commit()
        Commit changes on the connection
        Since:
        3.3.0
      • inTransaction

        boolean inTransaction()
        Determine if currently within a transaction
        Returns:
        true if in transaction
        Since:
        3.3.0
      • callInTransaction

        <T> T callInTransaction​(Callable<T> callable)
                         throws SQLException
        Execute the Callable class inside an ORMLite transaction
        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
        Since:
        3.3.0
      • enableForeignKeys

        boolean enableForeignKeys()
        If foreign keys is disabled and there are no foreign key violations, enables foreign key checks, else logs violations
        Returns:
        true if enabled or already enabled, false if foreign key violations and not enabled
        Since:
        3.3.0
      • foreignKeys

        boolean foreignKeys()
        Query for the foreign keys value
        Returns:
        true if enabled, false if disabled
        Since:
        3.3.0
      • foreignKeys

        boolean foreignKeys​(boolean on)
        Change the foreign keys state
        Parameters:
        on - true to turn on, false to turn off
        Returns:
        previous foreign keys value
        Since:
        3.3.0
      • dropTable

        void dropTable​(String table)
        Drop the table if it exists. Drops the table with the table name, not limited to GeoPackage specific tables.
        Parameters:
        table - table name
        Since:
        1.1.5
      • dropView

        void dropView​(String view)
        Drop the view if it exists. Drops the view with the view name, not limited to GeoPackage specific tables.
        Parameters:
        view - view name
        Since:
        4.0.0
      • renameTable

        void renameTable​(String tableName,
                         String newTableName)
        Rename the table
        Parameters:
        tableName - table name
        newTableName - new table name
        Since:
        3.3.0
      • copyTable

        void copyTable​(String tableName,
                       String newTableName)
        Copy the table with transferred contents and extensions
        Parameters:
        tableName - table name
        newTableName - new table name
        Since:
        3.3.0
      • copyTableNoExtensions

        void copyTableNoExtensions​(String tableName,
                                   String newTableName)
        Copy the table with transferred contents but no extensions
        Parameters:
        tableName - table name
        newTableName - new table name
        Since:
        3.3.0
      • copyTableAsEmpty

        void copyTableAsEmpty​(String tableName,
                              String newTableName)
        Copy the table but leave the user table empty and without extensions
        Parameters:
        tableName - table name
        newTableName - new table name
        Since:
        3.3.0
      • vacuum

        void vacuum()
        Rebuild the GeoPackage, repacking it into a minimal amount of disk space
        Since:
        3.3.0
      • getExtensionManager

        ExtensionManager getExtensionManager()
        Get an extension manager on the GeoPackage
        Returns:
        extension manager
        Since:
        4.0.0
      • createUserTable

        void createUserTable​(UserTable<? extends UserColumn> table)
        Create a new user table
        Parameters:
        table - user table
        Since:
        3.0.1