Package mil.nga.geopackage.db.metadata
Class GeometryMetadataDataSource
- java.lang.Object
-
- mil.nga.geopackage.db.metadata.GeometryMetadataDataSource
-
public class GeometryMetadataDataSource extends Object
Table metadata Data Source
-
-
Field Summary
Fields Modifier and Type Field Description protected doubletoleranceQuery range tolerance
-
Constructor Summary
Constructors Constructor Description GeometryMetadataDataSource(GeoPackageMetadataDb db)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount(long geoPackageId, String tableName)Query for all table geometry metadata countlongcount(long geoPackageId, String tableName, BoundingBox boundingBox)Query for all table geometry metadata count matching the bounding box in the same projectionlongcount(long geoPackageId, String tableName, GeometryEnvelope envelope)Query for all table geometry metadata count matching the envelopelongcount(String geoPackage, String tableName)Query for all table geometry metadata countlongcount(String geoPackage, String tableName, BoundingBox boundingBox)Query for all table geometry metadata count matching the bounding box in the same projectionlongcount(String geoPackage, String tableName, GeometryEnvelope envelope)Query for all table geometry metadata count matching the envelopeGeometryMetadatacreate(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope)Create a new geometry metadata from an envelopeGeometryMetadatacreate(String geoPackage, String tableName, long geomId, GeometryEnvelope envelope)Create a new geometry metadata from an envelopelongcreate(GeometryMetadata metadata)Create a new geometry metadatastatic GeometryMetadatacreateGeometryMetadata(Cursor cursor)Create a geometry metadata from the current cursor locationbooleancreateOrUpdate(GeometryMetadata metadata)Create the geometry metadata or update if it already existsintdelete(long geoPackageId)Delete geometry metadata by databaseintdelete(long geoPackageId, String tableName)Delete geometry metadata by table namebooleandelete(long geoPackageId, String tableName, long id)Delete the geometry metadataintdelete(String geoPackage)Delete geometry metadata by databaseintdelete(String geoPackage, String tableName)Delete geometry metadata by table namebooleandelete(String geoPackage, String tableName, long id)Delete the geometry metadatabooleandelete(GeometryMetadata metadata)Delete the geometry metadatabooleanexists(GeometryMetadata metadata)Check if a table metadata existsGeometryMetadataget(long geoPackageId, String tableName, long id)Get a table metadataGeometryMetadataget(String geoPackage, String tableName, long id)Get a table metadataGeometryMetadataget(GeometryMetadata metadata)Get a table metadataBoundingBoxgetBoundingBox(long geoPackageId, String tableName)Query for the bounds of the feature table indexBoundingBoxgetBoundingBox(String geoPackage, String tableName)Query for the bounds of the feature table indexlonggetGeoPackageId(String geoPackage)Get a GeoPackage id from the namestatic longgetId(Cursor cursor)Get the geometry metadata geometry iddoublegetTolerance()Get the query range toleranceGeometryMetadatapopulate(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope)Populate a new geometry metadata from an envelopeCursorquery(long geoPackageId, String tableName)Query for all table geometry metadataCursorquery(long geoPackageId, String tableName, String[] columns)Query for all table geometry metadataCursorquery(long geoPackageId, String tableName, String[] columns, BoundingBox boundingBox)Query for all table geometry metadata matching the bounding box in the same projectionCursorquery(long geoPackageId, String tableName, String[] columns, GeometryEnvelope envelope)Query for all table geometry metadata matching the envelopeCursorquery(long geoPackageId, String tableName, BoundingBox boundingBox)Query for all table geometry metadata matching the bounding box in the same projectionCursorquery(long geoPackageId, String tableName, GeometryEnvelope envelope)Query for all table geometry metadata matching the envelopeCursorquery(String geoPackage, String tableName)Query for all table geometry metadataCursorquery(String geoPackage, String tableName, String[] columns)Query for all table geometry metadataCursorquery(String geoPackage, String tableName, String[] columns, BoundingBox boundingBox)Query for all table geometry metadata matching the bounding box in the same projectionCursorquery(String geoPackage, String tableName, String[] columns, GeometryEnvelope envelope)Query for all table geometry metadata matching the envelopeCursorquery(String geoPackage, String tableName, BoundingBox boundingBox)Query for all table geometry metadata matching the bounding box in the same projectionCursorquery(String geoPackage, String tableName, GeometryEnvelope envelope)Query for all table geometry metadata matching the envelopeCursorqueryIds(long geoPackageId, String tableName)Query for all table geometry metadata geometry idsCursorqueryIds(long geoPackageId, String tableName, BoundingBox boundingBox)Query for all table geometry metadata ids matching the bounding box in the same projectionCursorqueryIds(long geoPackageId, String tableName, GeometryEnvelope envelope)Query for all table geometry metadata ids matching the envelopeCursorqueryIds(String geoPackage, String tableName)Query for all table geometry metadata geometry idsCursorqueryIds(String geoPackage, String tableName, BoundingBox boundingBox)Query for all table geometry metadata ids matching the bounding box in the same projectionCursorqueryIds(String geoPackage, String tableName, GeometryEnvelope envelope)Query for all table geometry metadata ids matching the envelopeStringquerySQL()Get the query SQL for a GeoPackage id and table nameStringquerySQL(GeometryEnvelope envelope)Get the query SQL for an envelope, GeoPackage id, and table nameString[]querySQLArgs(long geoPackageId, String tableName)Get the query SQL args for a GeoPackage id and table nameString[]querySQLArgs(GeometryEnvelope envelope, long geoPackageId, String tableName)Get the query SQL args for an envelope, GeoPackage id, and table namevoidsetTolerance(double tolerance)Set the query range tolerancebooleanupdate(GeometryMetadata metadata)Update the geometry metadata
-
-
-
Constructor Detail
-
GeometryMetadataDataSource
public GeometryMetadataDataSource(GeoPackageMetadataDb db)
Constructor- Parameters:
db- metadata db
-
-
Method Detail
-
getTolerance
public double getTolerance()
Get the query range tolerance- Returns:
- query range tolerance
-
setTolerance
public void setTolerance(double tolerance)
Set the query range tolerance- Parameters:
tolerance- query range tolerance
-
create
public long create(GeometryMetadata metadata)
Create a new geometry metadata- Parameters:
metadata- geometry metadata- Returns:
- id
-
create
public GeometryMetadata create(String geoPackage, String tableName, long geomId, GeometryEnvelope envelope)
Create a new geometry metadata from an envelope- Parameters:
geoPackage- GeoPackage nametableName- table namegeomId- geometry idenvelope- geometry envelope- Returns:
- geometry metadata
-
create
public GeometryMetadata create(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope)
Create a new geometry metadata from an envelope- Parameters:
geoPackageId- GeoPackage idtableName- table namegeomId- geometry idenvelope- geometry envelope- Returns:
- geometry metadata
-
populate
public GeometryMetadata populate(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope)
Populate a new geometry metadata from an envelope- Parameters:
geoPackageId- GeoPackage idtableName- table namegeomId- geometry idenvelope- geometry envelope- Returns:
- geometry metadata
-
delete
public boolean delete(GeometryMetadata metadata)
Delete the geometry metadata- Parameters:
metadata- geometry metadata- Returns:
- deleted count
-
delete
public int delete(String geoPackage)
Delete geometry metadata by database- Parameters:
geoPackage- GeoPackage name- Returns:
- deleted count
-
delete
public int delete(long geoPackageId)
Delete geometry metadata by database- Parameters:
geoPackageId- GeoPackage id- Returns:
- deleted count
-
delete
public int delete(String geoPackage, String tableName)
Delete geometry metadata by table name- Parameters:
geoPackage- GeoPackage nametableName- table name- Returns:
- deleted count
-
delete
public int delete(long geoPackageId, String tableName)Delete geometry metadata by table name- Parameters:
geoPackageId- GeoPackage idtableName- table name- Returns:
- deleted count
-
delete
public boolean delete(String geoPackage, String tableName, long id)
Delete the geometry metadata- Parameters:
geoPackage- GeoPackage nametableName- table nameid- id- Returns:
- deleted flag
-
delete
public boolean delete(long geoPackageId, String tableName, long id)Delete the geometry metadata- Parameters:
geoPackageId- GeoPackage idtableName- table nameid- id- Returns:
- deleted flag
-
createOrUpdate
public boolean createOrUpdate(GeometryMetadata metadata)
Create the geometry metadata or update if it already exists- Parameters:
metadata- geometry metadata- Returns:
- created flag
-
update
public boolean update(GeometryMetadata metadata)
Update the geometry metadata- Parameters:
metadata- geometry metadata- Returns:
- updated flag
-
exists
public boolean exists(GeometryMetadata metadata)
Check if a table metadata exists- Parameters:
metadata- geometry metadata- Returns:
- exists flag
-
get
public GeometryMetadata get(GeometryMetadata metadata)
Get a table metadata- Parameters:
metadata- geometry metadata- Returns:
- geometry metadata
-
get
public GeometryMetadata get(String geoPackage, String tableName, long id)
Get a table metadata- Parameters:
geoPackage- GeoPackage nametableName- table nameid- id- Returns:
- geometry metadata
-
get
public GeometryMetadata get(long geoPackageId, String tableName, long id)
Get a table metadata- Parameters:
geoPackageId- GeoPackage idtableName- table nameid- id- Returns:
- geometry metadata
-
query
public Cursor query(String geoPackage, String tableName)
Query for all table geometry metadata- Parameters:
geoPackage- GeoPackage nametableName- table name- Returns:
- cursor that must be closed
-
queryIds
public Cursor queryIds(String geoPackage, String tableName)
Query for all table geometry metadata geometry ids- Parameters:
geoPackage- GeoPackage nametableName- table name- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
query
public Cursor query(String geoPackage, String tableName, String[] columns)
Query for all table geometry metadata- Parameters:
geoPackage- GeoPackage nametableName- table namecolumns- queried columns- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
count
public long count(String geoPackage, String tableName)
Query for all table geometry metadata count- Parameters:
geoPackage- GeoPackage nametableName- table name- Returns:
- count
- Since:
- 3.4.0
-
getBoundingBox
public BoundingBox getBoundingBox(String geoPackage, String tableName)
Query for the bounds of the feature table index- Parameters:
geoPackage- GeoPackage nametableName- table name- Returns:
- bounding box
- Since:
- 3.1.0
-
getBoundingBox
public BoundingBox getBoundingBox(long geoPackageId, String tableName)
Query for the bounds of the feature table index- Parameters:
geoPackageId- GeoPackage idtableName- table name- Returns:
- bounding box
- Since:
- 3.1.0
-
query
public Cursor query(long geoPackageId, String tableName)
Query for all table geometry metadata- Parameters:
geoPackageId- GeoPackage idtableName- table name- Returns:
- cursor that must be closed
-
queryIds
public Cursor queryIds(long geoPackageId, String tableName)
Query for all table geometry metadata geometry ids- Parameters:
geoPackageId- GeoPackage idtableName- table name- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
query
public Cursor query(long geoPackageId, String tableName, String[] columns)
Query for all table geometry metadata- Parameters:
geoPackageId- GeoPackage idtableName- table namecolumns- queried columns- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
count
public long count(long geoPackageId, String tableName)Query for all table geometry metadata count- Parameters:
geoPackageId- GeoPackage idtableName- table name- Returns:
- count
- Since:
- 3.4.0
-
querySQL
public String querySQL()
Get the query SQL for a GeoPackage id and table name- Returns:
- SQL
- Since:
- 3.4.0
-
querySQLArgs
public String[] querySQLArgs(long geoPackageId, String tableName)
Get the query SQL args for a GeoPackage id and table name- Parameters:
geoPackageId- GeoPackage idtableName- table name- Returns:
- SQL args
- Since:
- 3.4.0
-
query
public Cursor query(String geoPackage, String tableName, BoundingBox boundingBox)
Query for all table geometry metadata matching the bounding box in the same projection- Parameters:
geoPackage- GeoPackage nametableName- table nameboundingBox- bounding box- Returns:
- cursor that must be closed
-
queryIds
public Cursor queryIds(String geoPackage, String tableName, BoundingBox boundingBox)
Query for all table geometry metadata ids matching the bounding box in the same projection- Parameters:
geoPackage- GeoPackage nametableName- table nameboundingBox- bounding box- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
query
public Cursor query(String geoPackage, String tableName, String[] columns, BoundingBox boundingBox)
Query for all table geometry metadata matching the bounding box in the same projection- Parameters:
geoPackage- GeoPackage nametableName- table namecolumns- queried columnsboundingBox- bounding box- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
count
public long count(String geoPackage, String tableName, BoundingBox boundingBox)
Query for all table geometry metadata count matching the bounding box in the same projection- Parameters:
geoPackage- GeoPackage nametableName- table nameboundingBox- bounding box- Returns:
- count
- Since:
- 3.4.0
-
query
public Cursor query(long geoPackageId, String tableName, BoundingBox boundingBox)
Query for all table geometry metadata matching the bounding box in the same projection- Parameters:
geoPackageId- GeoPackage idtableName- table nameboundingBox- bounding box- Returns:
- cursor that must be closed
-
queryIds
public Cursor queryIds(long geoPackageId, String tableName, BoundingBox boundingBox)
Query for all table geometry metadata ids matching the bounding box in the same projection- Parameters:
geoPackageId- GeoPackage idtableName- table nameboundingBox- bounding box- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
query
public Cursor query(long geoPackageId, String tableName, String[] columns, BoundingBox boundingBox)
Query for all table geometry metadata matching the bounding box in the same projection- Parameters:
geoPackageId- GeoPackage idtableName- table namecolumns- queried columnsboundingBox- bounding box- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
count
public long count(long geoPackageId, String tableName, BoundingBox boundingBox)Query for all table geometry metadata count matching the bounding box in the same projection- Parameters:
geoPackageId- GeoPackage idtableName- table nameboundingBox- bounding box- Returns:
- count
- Since:
- 3.4.0
-
query
public Cursor query(String geoPackage, String tableName, GeometryEnvelope envelope)
Query for all table geometry metadata matching the envelope- Parameters:
geoPackage- GeoPackage nametableName- table nameenvelope- geometry envelope- Returns:
- cursor that must be closed
-
queryIds
public Cursor queryIds(String geoPackage, String tableName, GeometryEnvelope envelope)
Query for all table geometry metadata ids matching the envelope- Parameters:
geoPackage- GeoPackage nametableName- table nameenvelope- geometry envelope- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
query
public Cursor query(String geoPackage, String tableName, String[] columns, GeometryEnvelope envelope)
Query for all table geometry metadata matching the envelope- Parameters:
geoPackage- GeoPackage nametableName- table namecolumns- queried columnsenvelope- geometry envelope- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
count
public long count(String geoPackage, String tableName, GeometryEnvelope envelope)
Query for all table geometry metadata count matching the envelope- Parameters:
geoPackage- GeoPackage nametableName- table nameenvelope- geometry envelope- Returns:
- count
- Since:
- 3.4.0
-
query
public Cursor query(long geoPackageId, String tableName, GeometryEnvelope envelope)
Query for all table geometry metadata matching the envelope- Parameters:
geoPackageId- GeoPackage idtableName- table nameenvelope- geometry envelope- Returns:
- cursor that must be closed
-
queryIds
public Cursor queryIds(long geoPackageId, String tableName, GeometryEnvelope envelope)
Query for all table geometry metadata ids matching the envelope- Parameters:
geoPackageId- GeoPackage idtableName- table nameenvelope- geometry envelope- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
query
public Cursor query(long geoPackageId, String tableName, String[] columns, GeometryEnvelope envelope)
Query for all table geometry metadata matching the envelope- Parameters:
geoPackageId- GeoPackage idtableName- table namecolumns- queried columnsenvelope- geometry envelope- Returns:
- cursor that must be closed
- Since:
- 3.4.0
-
count
public long count(long geoPackageId, String tableName, GeometryEnvelope envelope)Query for all table geometry metadata count matching the envelope- Parameters:
geoPackageId- GeoPackage idtableName- table nameenvelope- geometry envelope- Returns:
- count
- Since:
- 3.4.0
-
querySQL
public String querySQL(GeometryEnvelope envelope)
Get the query SQL for an envelope, GeoPackage id, and table name- Parameters:
envelope- geometry envelope- Returns:
- SQL
- Since:
- 3.4.0
-
querySQLArgs
public String[] querySQLArgs(GeometryEnvelope envelope, long geoPackageId, String tableName)
Get the query SQL args for an envelope, GeoPackage id, and table name- Parameters:
envelope- geometry envelopegeoPackageId- GeoPackage idtableName- table name- Returns:
- SQL args
- Since:
- 3.4.0
-
getGeoPackageId
public long getGeoPackageId(String geoPackage)
Get a GeoPackage id from the name- Parameters:
geoPackage- GeoPackage name- Returns:
- id
-
createGeometryMetadata
public static GeometryMetadata createGeometryMetadata(Cursor cursor)
Create a geometry metadata from the current cursor location- Parameters:
cursor- cursor- Returns:
- geometry metadata
-
getId
public static long getId(Cursor cursor)
Get the geometry metadata geometry id- Parameters:
cursor- cursor- Returns:
- id
- Since:
- 3.4.0
-
-