Class GeometryMetadataDataSource


  • public class GeometryMetadataDataSource
    extends Object
    Table metadata Data Source
    • Field Detail

      • tolerance

        protected double tolerance
        Query range tolerance
    • 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 name
        tableName - table name
        geomId - geometry id
        envelope - 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 id
        tableName - table name
        geomId - geometry id
        envelope - 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 id
        tableName - table name
        geomId - geometry id
        envelope - 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 name
        tableName - table name
        Returns:
        deleted count
      • delete

        public int delete​(long geoPackageId,
                          String tableName)
        Delete geometry metadata by table name
        Parameters:
        geoPackageId - GeoPackage id
        tableName - table name
        Returns:
        deleted count
      • delete

        public boolean delete​(String geoPackage,
                              String tableName,
                              long id)
        Delete the geometry metadata
        Parameters:
        geoPackage - GeoPackage name
        tableName - table name
        id - id
        Returns:
        deleted flag
      • delete

        public boolean delete​(long geoPackageId,
                              String tableName,
                              long id)
        Delete the geometry metadata
        Parameters:
        geoPackageId - GeoPackage id
        tableName - table name
        id - 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​(String geoPackage,
                                    String tableName,
                                    long id)
        Get a table metadata
        Parameters:
        geoPackage - GeoPackage name
        tableName - table name
        id - id
        Returns:
        geometry metadata
      • get

        public GeometryMetadata get​(long geoPackageId,
                                    String tableName,
                                    long id)
        Get a table metadata
        Parameters:
        geoPackageId - GeoPackage id
        tableName - table name
        id - id
        Returns:
        geometry metadata
      • query

        public Cursor query​(String geoPackage,
                            String tableName)
        Query for all table geometry metadata
        Parameters:
        geoPackage - GeoPackage name
        tableName - 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 name
        tableName - 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 name
        tableName - table name
        columns - 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 name
        tableName - 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 name
        tableName - 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 id
        tableName - 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 id
        tableName - 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 id
        tableName - 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 id
        tableName - table name
        columns - 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 id
        tableName - 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 id
        tableName - 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 name
        tableName - table name
        boundingBox - 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 name
        tableName - table name
        boundingBox - 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 name
        tableName - table name
        columns - queried columns
        boundingBox - 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 name
        tableName - table name
        boundingBox - 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 id
        tableName - table name
        boundingBox - 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 id
        tableName - table name
        boundingBox - 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 id
        tableName - table name
        columns - queried columns
        boundingBox - 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 id
        tableName - table name
        boundingBox - 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 name
        tableName - table name
        envelope - 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 name
        tableName - table name
        envelope - 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 name
        tableName - table name
        columns - queried columns
        envelope - 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 name
        tableName - table name
        envelope - 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 id
        tableName - table name
        envelope - 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 id
        tableName - table name
        envelope - 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 id
        tableName - table name
        columns - queried columns
        envelope - 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 id
        tableName - table name
        envelope - 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 envelope
        geoPackageId - GeoPackage id
        tableName - 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