Class FeatureTableCoreIndex
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.nga.index.FeatureTableCoreIndex
-
public abstract class FeatureTableCoreIndex extends BaseExtension
Abstract core Feature Table Index NGA Extension implementation. This extension is used to index Geometries within a feature table by their minimum bounding box for bounding box queries. This extension is required to provide an index implementation when a SQLite version is used before SpatialLite support (Android).http://ngageoint.github.io/GeoPackage/docs/extensions/geometry-index.html
- Since:
- 1.1.0
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected intchunkLimitQuery single chunk limitstatic StringEXTENSION_AUTHORExtension authorstatic StringEXTENSION_DEFINITIONExtension definition URLstatic StringEXTENSION_NAMEExtension, with author and namestatic StringEXTENSION_NAME_NO_AUTHORExtension name without the authorprotected GeoPackageProgressprogressProgressprotected doubletoleranceQuery range tolerance-
Fields inherited from class mil.nga.geopackage.extension.BaseExtension
extensionsDao, geoPackage
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFeatureTableCoreIndex(GeoPackageCore geoPackage, String tableName, String columnName)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longcount()Query for all Geometry Index countlongcount(BoundingBox boundingBox)Query for Geometry Index count within the bounding box, projected correctlylongcount(BoundingBox boundingBox, Projection projection)Query for Geometry Index count within the bounding box, projected correctlylongcount(GeometryEnvelope envelope)Query for Geometry Index count within the Geometry EnvelopebooleancreateGeometryIndexTable()Create Geometry Index Table if it does not exist and index itbooleancreateTableIndexTable()Create the Table Index Table if it does not existbooleandeleteIndex()Delete the feature table indexintdeleteIndex(long geomId)Delete the index for the geometry idBoundingBoxgetBoundingBox()Query for the bounds of the feature table indexBoundingBoxgetBoundingBox(Projection projection)Query for the feature index bounds and return in the provided projectionintgetChunkLimit()Get the SQL query chunk limitStringgetColumnName()Get the column nameExtensionsgetExtension()Get the extensionGeometryIndexDaogetGeometryIndexDao()Get a Geometry Index DAOstatic GeometryIndexDaogetGeometryIndexDao(GeoPackageCoreConnection db)Get a Geometry Index DAOstatic GeometryIndexDaogetGeometryIndexDao(GeoPackageCore geoPackage)Get a Geometry Index DAOGeoPackageCoregetGeoPackage()Get the GeoPackageDategetLastIndexed()Get the date last indexedabstract ProjectiongetProjection()Get the feature projectionTableIndexgetTableIndex()Get the table indexTableIndexDaogetTableIndexDao()Get a Table Index DAOstatic TableIndexDaogetTableIndexDao(GeoPackageCoreConnection db)Get a Table Index DAOstatic TableIndexDaogetTableIndexDao(GeoPackageCore geoPackage)Get a Table Index DAOStringgetTableName()Get the table namedoublegetTolerance()Get the query range toleranceintindex()Index the feature table if neededintindex(boolean force)Index the feature tableprotected booleanindex(TableIndex tableIndex, long geomId, GeoPackageGeometryData geomData)Index the geometry id and geometry databooleanindexGeometryIndexTable()Index the Geometry Index Table if neededprotected abstract intindexTable(TableIndex tableIndex)Index the feature tablebooleanisIndexed()Determine if the feature table is indexedBoundingBoxprojectBoundingBox(BoundingBox boundingBox, Projection projection)Project the provided bounding box in the declared projection to the user DAO projectionCloseableIterator<GeometryIndex>query()Query for all Geometry Index objectsCloseableIterator<GeometryIndex>query(BoundingBox boundingBox)Query for Geometry Index objects within the bounding box, projected correctlyCloseableIterator<GeometryIndex>query(BoundingBox boundingBox, Projection projection)Query for Geometry Index objects within the bounding box, projected correctlyCloseableIterator<GeometryIndex>query(GeometryEnvelope envelope)Query for Geometry Index objects within the Geometry EnvelopeQueryBuilder<GeometryIndex,GeometryIndexKey>queryBuilder()Build a query builder to query for all Geometry Index objectsQueryBuilder<GeometryIndex,GeometryIndexKey>queryBuilder(GeometryEnvelope envelope)Build a query builder to query for Geometry Index objects within the Geometry EnvelopeStringqueryIdsSQL()Query SQL for all row idsStringqueryIdsSQL(GeometryEnvelope envelope)Query SQL for all row idsvoidsetChunkLimit(int chunkLimit)Set the SQL query chunk limitvoidsetProgress(GeoPackageProgress progress)Set the progress trackervoidsetTolerance(double tolerance)Set the query range tolerancebooleanunindexGeometryIndexTable()Un-index the Geometry Index Table if neededprotected voidupdateLastIndexed()Update the last indexed time-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getOrCreate, has, has, has, verifyWritable
-
-
-
-
Field Detail
-
EXTENSION_AUTHOR
public static final String EXTENSION_AUTHOR
Extension author- See Also:
- Constant Field Values
-
EXTENSION_NAME_NO_AUTHOR
public static final String EXTENSION_NAME_NO_AUTHOR
Extension name without the author- See Also:
- Constant Field Values
-
EXTENSION_NAME
public static final String EXTENSION_NAME
Extension, with author and name
-
EXTENSION_DEFINITION
public static final String EXTENSION_DEFINITION
Extension definition URL
-
progress
protected GeoPackageProgress progress
Progress
-
chunkLimit
protected int chunkLimit
Query single chunk limit
-
tolerance
protected double tolerance
Query range tolerance
-
-
Constructor Detail
-
FeatureTableCoreIndex
protected FeatureTableCoreIndex(GeoPackageCore geoPackage, String tableName, String columnName)
Constructor- Parameters:
geoPackage- GeoPackagetableName- table namecolumnName- column name
-
-
Method Detail
-
getProjection
public abstract Projection getProjection()
Get the feature projection- Returns:
- projection
- Since:
- 3.1.0
-
getGeoPackage
public GeoPackageCore getGeoPackage()
Get the GeoPackage- Overrides:
getGeoPackagein classBaseExtension- Returns:
- GeoPackage
-
getTableName
public String getTableName()
Get the table name- Returns:
- table name
-
getColumnName
public String getColumnName()
Get the column name- Returns:
- column name
-
setProgress
public void setProgress(GeoPackageProgress progress)
Set the progress tracker- Parameters:
progress- progress tracker
-
getChunkLimit
public int getChunkLimit()
Get the SQL query chunk limit- Returns:
- chunk limit
- Since:
- 3.1.0
-
setChunkLimit
public void setChunkLimit(int chunkLimit)
Set the SQL query chunk limit- Parameters:
chunkLimit- chunk limit- Since:
- 3.1.0
-
getTolerance
public double getTolerance()
Get the query range tolerance- Returns:
- query range tolerance
- Since:
- 3.1.0
-
setTolerance
public void setTolerance(double tolerance)
Set the query range tolerance- Parameters:
tolerance- query range tolerance- Since:
- 3.1.0
-
index
public int index()
Index the feature table if needed- Returns:
- count
-
index
public int index(boolean force)
Index the feature table- Parameters:
force- true to force re-indexing- Returns:
- count
-
indexTable
protected abstract int indexTable(TableIndex tableIndex)
Index the feature table- Parameters:
tableIndex- table index- Returns:
- count
-
index
protected boolean index(TableIndex tableIndex, long geomId, GeoPackageGeometryData geomData)
Index the geometry id and geometry data- Parameters:
tableIndex- table indexgeomId- geometry idgeomData- geometry data- Returns:
- true if indexed
-
updateLastIndexed
protected void updateLastIndexed()
Update the last indexed time
-
deleteIndex
public boolean deleteIndex()
Delete the feature table index- Returns:
- true if index deleted
-
deleteIndex
public int deleteIndex(long geomId)
Delete the index for the geometry id- Parameters:
geomId- geometry id- Returns:
- deleted rows, should be 0 or 1
-
isIndexed
public boolean isIndexed()
Determine if the feature table is indexed- Returns:
- true if indexed
-
getTableIndex
public TableIndex getTableIndex()
Get the table index- Returns:
- table index
-
getLastIndexed
public Date getLastIndexed()
Get the date last indexed- Returns:
- last indexed date or null
-
getExtension
public Extensions getExtension()
Get the extension- Returns:
- extensions object or null if one does not exist
-
getTableIndexDao
public TableIndexDao getTableIndexDao()
Get a Table Index DAO- Returns:
- table index dao
- Since:
- 4.0.0
-
getTableIndexDao
public static TableIndexDao getTableIndexDao(GeoPackageCore geoPackage)
Get a Table Index DAO- Parameters:
geoPackage- GeoPackage- Returns:
- table index dao
- Since:
- 4.0.0
-
getTableIndexDao
public static TableIndexDao getTableIndexDao(GeoPackageCoreConnection db)
Get a Table Index DAO- Parameters:
db- database connection- Returns:
- table index dao
- Since:
- 4.0.0
-
createTableIndexTable
public boolean createTableIndexTable()
Create the Table Index Table if it does not exist- Returns:
- true if created
- Since:
- 4.0.0
-
getGeometryIndexDao
public GeometryIndexDao getGeometryIndexDao()
Get a Geometry Index DAO- Returns:
- geometry index dao
- Since:
- 4.0.0
-
getGeometryIndexDao
public static GeometryIndexDao getGeometryIndexDao(GeoPackageCore geoPackage)
Get a Geometry Index DAO- Parameters:
geoPackage- GeoPackage- Returns:
- geometry index dao
- Since:
- 4.0.0
-
getGeometryIndexDao
public static GeometryIndexDao getGeometryIndexDao(GeoPackageCoreConnection db)
Get a Geometry Index DAO- Parameters:
db- database connection- Returns:
- geometry index dao
- Since:
- 4.0.0
-
createGeometryIndexTable
public boolean createGeometryIndexTable()
Create Geometry Index Table if it does not exist and index it- Returns:
- true if created
- Since:
- 4.0.0
-
indexGeometryIndexTable
public boolean indexGeometryIndexTable()
Index the Geometry Index Table if needed- Returns:
- true if indexed
- Since:
- 4.0.0
-
unindexGeometryIndexTable
public boolean unindexGeometryIndexTable()
Un-index the Geometry Index Table if needed- Returns:
- true if unindexed
- Since:
- 4.0.0
-
query
public CloseableIterator<GeometryIndex> query()
Query for all Geometry Index objects- Returns:
- geometry indices iterator
-
queryIdsSQL
public String queryIdsSQL()
Query SQL for all row ids- Returns:
- SQL
- Since:
- 3.4.0
-
count
public long count()
Query for all Geometry Index count- Returns:
- count
-
getBoundingBox
public BoundingBox getBoundingBox()
Query for the bounds of the feature table index- Returns:
- bounding box
- Since:
- 3.1.0
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection)
Query for the feature index bounds and return in the provided projection- Parameters:
projection- desired projection- Returns:
- bounding box
- Since:
- 3.1.0
-
queryBuilder
public QueryBuilder<GeometryIndex,GeometryIndexKey> queryBuilder()
Build a query builder to query for all Geometry Index objects- Returns:
- query builder
-
query
public CloseableIterator<GeometryIndex> query(BoundingBox boundingBox)
Query for Geometry Index objects within the bounding box, projected correctly- Parameters:
boundingBox- bounding box- Returns:
- geometry indices iterator
-
query
public CloseableIterator<GeometryIndex> query(BoundingBox boundingBox, Projection projection)
Query for Geometry Index objects within the bounding box, projected correctly- Parameters:
boundingBox- bounding boxprojection- projection of the provided bounding box- Returns:
- geometry indices iterator
-
count
public long count(BoundingBox boundingBox)
Query for Geometry Index count within the bounding box, projected correctly- Parameters:
boundingBox- bounding box- Returns:
- count
-
count
public long count(BoundingBox boundingBox, Projection projection)
Query for Geometry Index count within the bounding box, projected correctly- Parameters:
boundingBox- bounding boxprojection- projection of the provided bounding box- Returns:
- count
-
query
public CloseableIterator<GeometryIndex> query(GeometryEnvelope envelope)
Query for Geometry Index objects within the Geometry Envelope- Parameters:
envelope- geometry envelope- Returns:
- geometry indices iterator
-
queryIdsSQL
public String queryIdsSQL(GeometryEnvelope envelope)
Query SQL for all row ids- Parameters:
envelope- geometry envelope- Returns:
- SQL
- Since:
- 3.4.0
-
count
public long count(GeometryEnvelope envelope)
Query for Geometry Index count within the Geometry Envelope- Parameters:
envelope- geometry envelope- Returns:
- count
-
queryBuilder
public QueryBuilder<GeometryIndex,GeometryIndexKey> queryBuilder(GeometryEnvelope envelope)
Build a query builder to query for Geometry Index objects within the Geometry Envelope- Parameters:
envelope- geometry envelope- Returns:
- query builder
-
projectBoundingBox
public BoundingBox projectBoundingBox(BoundingBox boundingBox, Projection projection)
Project the provided bounding box in the declared projection to the user DAO projection- Parameters:
boundingBox- bounding boxprojection- projection- Returns:
- projected bounding box
- Since:
- 6.2.0
-
-