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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    FeatureSourceBookmarkResolver(nz.org.riskscape.engine.Engine engine)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected nz.org.riskscape.engine.bind.JavaParameterSet<BP>
     
    protected abstract DS
     
    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>
    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

      public static final LockDefeater LOCK_DEFEATER
    • DATA_LAYER

      public static final String 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 class RelationBookmarkResolver<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

      protected abstract DS createDataStore(BP params) throws MalformedURLException, IOException
      Parameters:
      params -
      Returns:
      a DataStore that can return the right kind of SimpleFeatureSource for the given Bookmark
      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 given DataStore according to the given Bookmark
    • buildParameterSet

      protected nz.org.riskscape.engine.bind.JavaParameterSet<BP> buildParameterSet()
      Overrides:
      buildParameterSet in class nz.org.riskscape.engine.data.BaseBookmarkResolver<BP extends RelationBookmarkParams>