Class OAPIFeatureCoreGenerator


  • public abstract class OAPIFeatureCoreGenerator
    extends FeatureCoreGenerator
    OGC API Features Generator
    Author:
    osbornb
    • Field Detail

      • LIMIT_PATTERN

        protected static final Pattern LIMIT_PATTERN
        Limit pattern
      • OGC_CRS84

        protected static final Projection OGC_CRS84
        OGC CRS84 Projection
      • DEFAULT_PROJECTIONS

        protected static final Projections DEFAULT_PROJECTIONS
        Default projections
      • server

        protected final String server
        Base server url
      • id

        protected final String id
        Identifier (name) of a specific collection
      • limit

        protected Integer limit
        The optional limit parameter limits the number of items that are presented in the response document.
      • time

        protected String time
        Either a date-time or a period string that adheres to RFC 3339
      • period

        protected String period
        Time period string that adheres to RFC 3339
      • totalLimit

        protected Integer totalLimit
        Total limit of number of items to request
      • downloadAttempts

        protected int downloadAttempts
        Download attempts per feature request
    • Constructor Detail

      • OAPIFeatureCoreGenerator

        public OAPIFeatureCoreGenerator​(GeoPackageCore geoPackage,
                                        String tableName,
                                        String server,
                                        String id)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tableName - table name
        server - server url
        id - collection identifier
    • Method Detail

      • getServer

        public String getServer()
        Get the server
        Returns:
        server
      • getId

        public String getId()
        Get the collection id
        Returns:
        collection id
      • getLimit

        public Integer getLimit()
        Get the limit
        Returns:
        limit
      • setLimit

        public void setLimit​(Integer limit)
        Set the limit
        Parameters:
        limit - limit
      • getTime

        public String getTime()
        Get the time
        Returns:
        time
      • setTime

        public void setTime​(String time)
        Set the time
        Parameters:
        time - time
      • setTime

        public void setTime​(Date time)
        Set the time
        Parameters:
        time - time
      • getPeriod

        public String getPeriod()
        Get the time period
        Returns:
        period
      • setPeriod

        public void setPeriod​(String period)
        Set the time period
        Parameters:
        period - period
      • setPeriod

        public void setPeriod​(Date period)
        Set the time period
        Parameters:
        period - period
      • getTotalLimit

        public Integer getTotalLimit()
        Get the total limit
        Returns:
        total limit
      • setTotalLimit

        public void setTotalLimit​(Integer totalLimit)
        Set the total limit
        Parameters:
        totalLimit - total limit
      • getDownloadAttempts

        public int getDownloadAttempts()
        Get the number of download attempts
        Returns:
        download attempts
      • setDownloadAttempts

        public void setDownloadAttempts​(int downloadAttempts)
        Set the number of download attempts
        Parameters:
        downloadAttempts - download attempts
      • createFeature

        protected void createFeature​(Feature feature)
                              throws SQLException
        Create the feature
        Parameters:
        feature - feature
        Throws:
        SQLException - upon error
      • buildCollectionRequestUrl

        protected String buildCollectionRequestUrl()
        Build the collection request URL
        Returns:
        url
      • getProjections

        public Projections getProjections()
        Get the supported projections
        Returns:
        projections
      • getProjections

        public Projections getProjections​(String url)
        Get the supported projections
        Parameters:
        url - URL
        Returns:
        projections
      • getProjections

        public Projections getProjections​(Collection collection)
        Get the supported projections
        Parameters:
        collection - collection
        Returns:
        projections
      • requestProjection

        public boolean requestProjection​(Projection projection)
        Determine if the projection should be requested from the server
        Parameters:
        projection - projection
        Returns:
        true to request the projection (non null and non default)
      • isDefaultProjection

        public boolean isDefaultProjection​(Projection projection)
        Check if the projection is a default projection
        Parameters:
        projection - projection
        Returns:
        true if default projection
      • collectionRequest

        public Collection collectionRequest()
        Collection request
        Returns:
        collection
      • collectionRequest

        protected Collection collectionRequest​(String url)
        Collection request for the provided URL
        Parameters:
        url - url value
        Returns:
        collection
      • generateFeatures

        public int generateFeatures​(String urlString,
                                    int currentCount)
                             throws SQLException
        Generate features
        Parameters:
        urlString - URL
        currentCount - current count
        Returns:
        current result count
        Throws:
        SQLException - upon failure
      • urlRequest

        protected String urlRequest​(String urlValue)
        URL request
        Parameters:
        urlValue - URL value
        Returns:
        response string
      • urlRequest

        protected String urlRequest​(String urlValue,
                                    URL url)
        Perform a URL request
        Parameters:
        urlValue - URL string value
        url - URL
        Returns:
        features response
      • createFeatures

        protected FeatureCollection createFeatures​(String features)
                                            throws SQLException
        Create features in the feature DAO from the features value
        Parameters:
        features - features json
        Returns:
        feature collection
        Throws:
        SQLException - upon error
      • createFeatures

        protected int createFeatures​(FeatureCollection featureCollection)
        Create features from the feature collection
        Parameters:
        featureCollection - feature collection
        Returns:
        features created
      • getCrs

        protected Crs getCrs​(Projection projection)
        Get the CRS from the projection
        Parameters:
        projection - projection
        Returns:
        crs