Class FeatureSourceBookmarkResolver<DS extends org.geotools.api.data.DataStore,BP extends RelationBookmarkParams>
java.lang.Object
nz.org.riskscape.engine.data.BaseBookmarkResolver<T>
nz.org.riskscape.engine.data.relation.RelationBookmarkResolver<BP>
nz.org.riskscape.engine.data.relation.FeatureSourceBookmarkResolver<DS,BP>
- All Implemented Interfaces:
nz.org.riskscape.engine.data.BookmarkResolver
,nz.org.riskscape.engine.Identified
public abstract class FeatureSourceBookmarkResolver<DS extends org.geotools.api.data.DataStore,BP extends RelationBookmarkParams>
extends RelationBookmarkResolver<BP>
Provides a basic framework for constructing a FeatureSourceRelation
from the various geotools APIs
-
Nested Class Summary
Nested classes/interfaces inherited from class nz.org.riskscape.engine.data.BaseBookmarkResolver
nz.org.riskscape.engine.data.BaseBookmarkResolver.ProblemCodes
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
If set the named layer will be used for this bookmark, else the first layer from the data source is used.static final LockDefeater
Fields inherited from class nz.org.riskscape.engine.data.relation.RelationBookmarkResolver
v2r
Fields inherited from class nz.org.riskscape.engine.data.BaseBookmarkResolver
engine
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected nz.org.riskscape.engine.bind.JavaParameterSet<BP>
protected abstract DS
createDataStore
(BP params) protected nz.org.riskscape.problem.ResultOrProblems<org.geotools.api.data.SimpleFeatureSource>
createFeatureSource
(BP params, DS dataStore) protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.relation.Relation>
createRawRelationFromBookmark
(BP params) Construct the raw, unadulterated relation from the bookmark.org.geotools.api.referencing.crs.CoordinateReferenceSystem
crsAtAllCosts
(BP params, org.geotools.api.data.SimpleFeatureSource sfs) protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.relation.Relation>
wrapRelation
(BP params, DS dataStore, FeatureSourceRelation relation, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) Methods inherited from class nz.org.riskscape.engine.data.relation.RelationBookmarkResolver
applyFilter, build, getAliasMapping, getV2r, rasterize, setV2r, validateParameters
Methods inherited from class nz.org.riskscape.engine.data.BaseBookmarkResolver
attemptPrjParse, attemptPrjParse, bindAndValidate, checkFile, getBookmarkedPath, getBookmarkedPathOr, getEngine, getExtensions, getExtensionsToFormats, getFormat, getFormats, getParameterSet, getParamsClass, newResolved, resolve, setCrs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.data.BookmarkResolver
getId, getName, supportedParameters
Methods inherited from interface nz.org.riskscape.engine.Identified
getIdentifiedClass
-
Field Details
-
LOCK_DEFEATER
-
DATA_LAYER
If set the named layer will be used for this bookmark, else the first layer from the data source is used.
- See Also:
-
-
Constructor Details
-
FeatureSourceBookmarkResolver
public FeatureSourceBookmarkResolver(nz.org.riskscape.engine.Engine engine)
-
-
Method Details
-
wrapRelation
protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.relation.Relation> wrapRelation(BP params, DS dataStore, FeatureSourceRelation relation, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) -
createRawRelationFromBookmark
protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.relation.Relation> createRawRelationFromBookmark(BP params) Description copied from class:RelationBookmarkResolver
Construct the raw, unadulterated relation from the bookmark. Won't be called if validation includes errors.
- Specified by:
createRawRelationFromBookmark
in classRelationBookmarkResolver<BP extends RelationBookmarkParams>
- Returns:
- the
Relation
that returns data from some specific format and location
-
crsAtAllCosts
public org.geotools.api.referencing.crs.CoordinateReferenceSystem crsAtAllCosts(BP params, org.geotools.api.data.SimpleFeatureSource sfs) -
createDataStore
- Parameters:
params
-- Returns:
- a
DataStore
that can return the right kind ofSimpleFeatureSource
for the givenBookmark
- Throws:
IOException
MalformedURLException
-
createFeatureSource
protected nz.org.riskscape.problem.ResultOrProblems<org.geotools.api.data.SimpleFeatureSource> createFeatureSource(BP params, DS dataStore) - Returns:
- a
SimpleFeatureSource
from the givenDataStore
according to the givenBookmark
-
buildParameterSet
- Overrides:
buildParameterSet
in classnz.org.riskscape.engine.data.BaseBookmarkResolver<BP extends RelationBookmarkParams>
-