Class FeatureSourceBookmarkResolver<DS extends org.geotools.api.data.DataStore,BP extends FeatureSourceBookmarkResolver.FeatureSourceBookmarkParams>
- All Implemented Interfaces:
nz.org.riskscape.engine.data.BookmarkResolver,nz.org.riskscape.engine.Identified
Provides a basic framework for constructing a FeatureSourceRelation from the various geotools APIs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested 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 voidvalidateParameters(BP params, nz.org.riskscape.engine.bind.BindingContext context) 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) Wrap theFeatureSourceSourceRelationto make it's content compatible with the broader RiskScape system.Methods inherited from class nz.org.riskscape.engine.data.relation.RelationBookmarkResolver
applyFilter, build, getAliasMapping, getV2r, postBuild, rasterize, setV2rMethods 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) Wrap the
FeatureSourceSourceRelationto make it's content compatible with the broader RiskScape system.At the least this will should include the
LinearGeometryProjectionto ensure curved geometries are not emitted.Subclasses may also need to add in the
ForceSridProjectionif the feature source does not make use of the correct geometry factory (thus not setting a RiskScape compatible SRID). -
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 FeatureSourceBookmarkResolver.FeatureSourceBookmarkParams>- 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 FeatureSourceBookmarkResolver.FeatureSourceBookmarkParams>
-
checkDataValid
Sanity-check we can read the underlying data source using
-
validateParameters
- Overrides:
validateParametersin classRelationBookmarkResolver<BP extends FeatureSourceBookmarkResolver.FeatureSourceBookmarkParams>
-