Package mil.nga.geopackage.features
Class OAPIFeatureCoreGenerator
- java.lang.Object
-
- mil.nga.geopackage.features.FeatureCoreGenerator
-
- mil.nga.geopackage.features.OAPIFeatureCoreGenerator
-
public abstract class OAPIFeatureCoreGenerator extends FeatureCoreGenerator
OGC API Features Generator- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected static ProjectionsDEFAULT_PROJECTIONSDefault projectionsprotected intdownloadAttemptsDownload attempts per feature requestprotected static StringEPSG_VERSIONEPSG CRS Versionprotected StringidIdentifier (name) of a specific collectionprotected IntegerlimitThe optional limit parameter limits the number of items that are presented in the response document.protected static PatternLIMIT_PATTERNLimit patternprotected static ProjectionOGC_CRS84OGC CRS84 Projectionprotected static StringOGC_VERSIONOGC CRS Versionprotected StringperiodTime period string that adheres to RFC 3339protected StringserverBase server urlprotected StringtimeEither a date-time or a period string that adheres to RFC 3339protected IntegertotalLimitTotal limit of number of items to request-
Fields inherited from class mil.nga.geopackage.features.FeatureCoreGenerator
boundingBox, boundingBoxProjection, columns, EPSG_WGS84, geometryColumns, geoPackage, progress, projection, srs, tableName, transactionLimit
-
-
Constructor Summary
Constructors Constructor Description OAPIFeatureCoreGenerator(GeoPackageCore geoPackage, String tableName, String server, String id)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringbuildCollectionRequestUrl()Build the collection request URLCollectioncollectionRequest()Collection requestprotected CollectioncollectionRequest(String url)Collection request for the provided URLprotected voidcreateFeature(Feature feature)Create the featureprotected FeatureCollectioncreateFeatures(String features)Create features in the feature DAO from the features valueprotected intcreateFeatures(FeatureCollection featureCollection)Create features from the feature collectionintgenerateFeatures()Generate the featuresintgenerateFeatures(String urlString, int currentCount)Generate featuresprotected CrsgetCrs(Projection projection)Get the CRS from the projectionintgetDownloadAttempts()Get the number of download attemptsStringgetId()Get the collection idIntegergetLimit()Get the limitStringgetPeriod()Get the time periodProjectionsgetProjections()Get the supported projectionsProjectionsgetProjections(String url)Get the supported projectionsProjectionsgetProjections(Collection collection)Get the supported projectionsStringgetServer()Get the serverprotected ProjectiongetSrsProjection()Get the projection for creating the Spatial Reference SystemStringgetTime()Get the timeIntegergetTotalLimit()Get the total limitbooleanisDefaultProjection(Projection projection)Check if the projection is a default projectionbooleanrequestProjection(Projection projection)Determine if the projection should be requested from the servervoidsetDownloadAttempts(int downloadAttempts)Set the number of download attemptsvoidsetLimit(Integer limit)Set the limitvoidsetPeriod(String period)Set the time periodvoidsetPeriod(Date period)Set the time periodvoidsetTime(String time)Set the timevoidsetTime(Date time)Set the timevoidsetTotalLimit(Integer totalLimit)Set the total limitprotected StringurlRequest(String urlValue)URL requestprotected StringurlRequest(String urlValue, URL url)Perform a URL request-
Methods inherited from class mil.nga.geopackage.features.FeatureCoreGenerator
addColumn, addProjection, createColumn, createFeature, createGeometryData, createProjection, createSrs, createTable, getBoundingBox, getBoundingBoxProjection, getColumn, getColumns, getGeometryColumns, getGeoPackage, getProgress, getProjection, getSrs, getTableName, getTransactionLimit, getType, getValue, getValue, initializeTable, isActive, saveFeature, setBoundingBox, setBoundingBoxProjection, setProgress, setProjection, setTransactionLimit
-
-
-
-
Field Detail
-
LIMIT_PATTERN
protected static final Pattern LIMIT_PATTERN
Limit pattern
-
OGC_CRS84
protected static final Projection OGC_CRS84
OGC CRS84 Projection
-
OGC_VERSION
protected static final String OGC_VERSION
OGC CRS Version- See Also:
- Constant Field Values
-
EPSG_VERSION
protected static final String EPSG_VERSION
EPSG CRS Version- See Also:
- Constant Field Values
-
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- GeoPackagetableName- table nameserver- server urlid- 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
-
getSrsProjection
protected Projection getSrsProjection()
Get the projection for creating the Spatial Reference System- Overrides:
getSrsProjectionin classFeatureCoreGenerator- Returns:
- projection
-
createFeature
protected void createFeature(Feature feature) throws SQLException
Create the feature- Parameters:
feature- feature- Throws:
SQLException- upon error
-
generateFeatures
public int generateFeatures() throws SQLExceptionGenerate the features- Specified by:
generateFeaturesin classFeatureCoreGenerator- Returns:
- generated count
- 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- URLcurrentCount- 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 valueurl- 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
-
-