Class FeatureCoreGenerator

    • Field Detail

      • EPSG_WGS84

        protected static final Projection EPSG_WGS84
        EPSG WGS84
      • tableName

        protected final String tableName
        Table Name
      • boundingBox

        protected BoundingBox boundingBox
        Features bounding box
      • boundingBoxProjection

        protected Projection boundingBoxProjection
        Bounding Box projection
      • projection

        protected Projection projection
        Features projection
      • transactionLimit

        protected int transactionLimit
        Number of rows to save in a single transaction
      • geometryColumns

        protected GeometryColumns geometryColumns
        Table Geometry Columns
    • Constructor Detail

      • FeatureCoreGenerator

        public FeatureCoreGenerator​(GeoPackageCore geoPackage,
                                    String tableName)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tableName - table name
    • Method Detail

      • getGeoPackage

        public GeoPackageCore getGeoPackage()
        Get the GeoPackage
        Returns:
        GeoPackage
      • getTableName

        public String getTableName()
        Get the table name
        Returns:
        table name
      • getBoundingBox

        public BoundingBox getBoundingBox()
        Get bounding box
        Returns:
        bounding box
      • setBoundingBox

        public void setBoundingBox​(BoundingBox boundingBox)
        Set the bounding box
        Parameters:
        boundingBox - bounding box
      • getBoundingBoxProjection

        public Projection getBoundingBoxProjection()
        Get the bounding box projection
        Returns:
        bounding box projection
      • setBoundingBoxProjection

        public void setBoundingBoxProjection​(Projection boundingBoxProjection)
        Set the bounding box projection
        Parameters:
        boundingBoxProjection - bounding box projection
      • getProjection

        public Projection getProjection()
        Get the projection
        Returns:
        projection
      • setProjection

        public void setProjection​(Projection projection)
        Set the projection
        Parameters:
        projection - projection
      • getTransactionLimit

        public int getTransactionLimit()
        Get the single transaction limit
        Returns:
        transaction limit
      • setTransactionLimit

        public void setTransactionLimit​(int transactionLimit)
        Set the single transaction limit
        Parameters:
        transactionLimit - transaction limit
      • getProgress

        public GeoPackageProgress getProgress()
        Get the progress
        Returns:
        progress
      • setProgress

        public void setProgress​(GeoPackageProgress progress)
        Set the progress
        Parameters:
        progress - progress
      • isActive

        public boolean isActive()
        Determine if the feature generator should remain active
        Returns:
        true if active
      • getGeometryColumns

        public GeometryColumns getGeometryColumns()
        Get the geometry columns
        Returns:
        geometry columns
      • generateFeatures

        public abstract int generateFeatures()
                                      throws SQLException
        Generate the features
        Returns:
        generated count
        Throws:
        SQLException - upon error
      • addColumn

        protected abstract void addColumn​(FeatureColumn featureColumn)
        Add a new column
        Parameters:
        featureColumn - feature column
      • initializeTable

        protected void initializeTable()
        Initialize after the feature table is created
      • saveFeature

        protected abstract void saveFeature​(Geometry geometry,
                                            Map<String,​Object> values)
        Save the feature
        Parameters:
        geometry - geometry
        values - column to value mapping
      • createSrs

        public void createSrs()
                       throws SQLException
        Create the Spatial Reference System
        Throws:
        SQLException - upon error
      • getSrsProjection

        protected Projection getSrsProjection()
        Get the projection for creating the Spatial Reference System
        Returns:
        projection
      • createTable

        protected void createTable​(Map<String,​Object> properties)
                            throws SQLException
        Create the feature table
        Parameters:
        properties - properties
        Throws:
        SQLException - upon error
      • getValue

        protected Object getValue​(String column,
                                  Object value)
        Get the column value
        Parameters:
        column - column name
        value - value
        Returns:
        column value
      • getColumn

        protected FeatureColumn getColumn​(String column,
                                          Object value)
        Get the column, create if needed
        Parameters:
        column - column name
        value - value
        Returns:
        feature column
      • createColumn

        protected FeatureColumn createColumn​(String name,
                                             Object value)
        Create a feature column
        Parameters:
        name - column name
        value - value
        Returns:
        feature column
      • createGeometryData

        protected GeoPackageGeometryData createGeometryData​(Geometry geometry)
        Create the geometry data
        Parameters:
        geometry - geometry
        Returns:
        geometry data
      • getType

        public static GeoPackageDataType getType​(Object value)
        Get the type for the object value
        Parameters:
        value - value
        Returns:
        data type
      • getValue

        public static Object getValue​(Object value,
                                      GeoPackageDataType type)
        Get the value for the object value with the data type
        Parameters:
        value - value
        type - data type
        Returns:
        default value
      • addProjection

        protected void addProjection​(Projections projections,
                                     String authority,
                                     String code)
        Add a projection
        Parameters:
        projections - projections
        authority - authority
        code - code
      • createProjection

        protected Projection createProjection​(String authority,
                                              String code)
        Create a projection
        Parameters:
        authority - authority
        code - code
        Returns:
        projection