public BoundingBox getBoundingBox ( ) { GenericRawResults < Object [ ] > results = null ; Object [ ] values = null ; try { results = geometryIndexDao . queryRaw ( "SELECT MIN(" + GeometryIndex . COLUMN_MIN_X + "), MIN(" + GeometryIndex . COLUMN_MIN_Y + "), MAX(" + GeometryIndex . COLUMN_MAX_X + "), MAX(" + GeometryIndex . COLUMN_MAX_Y + ") FROM " + GeometryIndex . TABLE_NAME + " WHERE " + GeometryIndex . COLUMN_TABLE_NAME + " = ?" , new DataType [ ] { DataType . DOUBLE , DataType . DOUBLE , DataType . DOUBLE , DataType . DOUBLE } , tableName ) ; values = results . getFirstResult ( ) ; } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to query for indexed feature bounds: " + tableName , e ) ; } finally { if ( results != null ) { try { results . close ( ) ; } catch ( IOException e ) { logger . log ( Level . WARNING , "Failed to close bounds query results" , e ) ; } } } BoundingBox boundingBox = new BoundingBox ( ( double ) values [ 0 ] , ( double ) values [ 1 ] , ( double ) values [ 2 ] , ( double ) values [ 3 ] ) ; return boundingBox ; }
Query for the bounds of the feature table index