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
FieldsModifier and TypeFieldDescriptionstatic final StringIf set the named layer will be used for this bookmark, else the first layer from the data source is used.static final LockDefeaterFields inherited from class nz.org.riskscape.engine.data.relation.RelationBookmarkResolver
v2rFields inherited from class nz.org.riskscape.engine.data.BaseBookmarkResolver
engine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected nz.org.riskscape.engine.bind.JavaParameterSet<BP>protected nz.org.riskscape.problem.ProblemscheckDataValid(BP params, DS dataStore) Sanity-check we can read the underlying data source usingprotected abstract DScreateDataStore(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.CoordinateReferenceSystemcrsAtAllCosts(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, validateParametersMethods 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, validateCommonParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nz.org.riskscape.engine.data.BookmarkResolver
getId, getNameMethods 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:RelationBookmarkResolverConstruct the raw, unadulterated relation from the bookmark. Won't be called if validation includes errors.
- Specified by:
createRawRelationFromBookmarkin classRelationBookmarkResolver<BP extends RelationBookmarkParams>- Returns:
- the
Relationthat 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
DataStorethat can return the right kind ofSimpleFeatureSourcefor the givenBookmark - Throws:
IOExceptionMalformedURLException
-
createFeatureSource
protected nz.org.riskscape.problem.ResultOrProblems<org.geotools.api.data.SimpleFeatureSource> createFeatureSource(BP params, DS dataStore) - Returns:
- a
SimpleFeatureSourcefrom the givenDataStoreaccording to the givenBookmark
-
buildParameterSet
- Overrides:
buildParameterSetin classnz.org.riskscape.engine.data.BaseBookmarkResolver<BP extends RelationBookmarkParams>
-
checkDataValid
Sanity-check we can read the underlying data source using
-