Class PagingFeatureSourceRelation

java.lang.Object
nz.org.riskscape.engine.relation.BaseRelation
nz.org.riskscape.engine.relation.PagingFeatureSourceRelation
All Implemented Interfaces:
AutoCloseable, nz.org.riskscape.engine.data.SelfDescribingScalarData, nz.org.riskscape.engine.pipeline.Realized, nz.org.riskscape.engine.relation.Relation

public class PagingFeatureSourceRelation extends nz.org.riskscape.engine.relation.BaseRelation

Like a FeatureSourceRelation, useful for working with FeatureStores that are backed by WFS.

This Relation is like the FeatureSourceRelation,except it will split up requests for features in to pages to work around potential max-feature limits on the underlying datastore (only seen in WFS so far). While FeatureSources are usually implemented to stream efficiently, which means we should not have to page, we might silently hit a feature limit such as the one Geoserver and the LINZ data service impose.

  • Nested Class Summary

    Nested classes/interfaces inherited from class nz.org.riskscape.engine.relation.BaseRelation

    nz.org.riskscape.engine.relation.BaseRelation.Fields, nz.org.riskscape.engine.relation.BaseRelation.Transformer
  • Field Summary

    Fields inherited from class nz.org.riskscape.engine.relation.BaseRelation

    skipOnInvalid, transformers
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    PagingFeatureSourceRelation(@NonNull nz.org.riskscape.engine.types.Struct type, @NonNull org.geotools.api.data.SimpleFeatureSource featureSource, @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull org.geotools.api.filter.Filter filter, @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs, int pageSize)
    protected
    PagingFeatureSourceRelation(nz.org.riskscape.engine.relation.BaseRelation.Fields fields, @NonNull org.geotools.api.data.SimpleFeatureSource featureSource, @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull org.geotools.api.filter.Filter filter, @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs, int pageSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected nz.org.riskscape.engine.relation.BaseRelation
    clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields)
     
     
    nz.org.riskscape.engine.relation.TupleIterator
     

    Methods inherited from class nz.org.riskscape.engine.relation.BaseRelation

    cloneWithProjectionIfSupported, cloneWithRestrictionIfSupported, cloneWithTransformer, getLimit, getOffset, getRawType, getSpatialMetadata, getType, hasSkipOnInvalid, iterator, limitAndOffset, project, restrict, skipInvalid, skipOrThrow, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.pipeline.Realized

    close

    Methods inherited from interface nz.org.riskscape.engine.relation.Relation

    calculateBounds, getScalarDataType, limit, offset, size, stream
  • Constructor Details

    • PagingFeatureSourceRelation

      public PagingFeatureSourceRelation(@NonNull @NonNull nz.org.riskscape.engine.types.Struct type, @NonNull @NonNull org.geotools.api.data.SimpleFeatureSource featureSource, @NonNull @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull @NonNull org.geotools.api.filter.Filter filter, @NonNull @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs, int pageSize)
      Parameters:
      type - the type as per Relation.getType()
      featureSource - the FeatureSource to page from
      sridSet - used for constructing Geometrys with the correct srid
      filter - a filter to apply to features in the FeatureSource
      pageSize - the size of each page. Should be less than the underlying data stores feature limit.
    • PagingFeatureSourceRelation

      protected PagingFeatureSourceRelation(nz.org.riskscape.engine.relation.BaseRelation.Fields fields, @NonNull @NonNull org.geotools.api.data.SimpleFeatureSource featureSource, @NonNull @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull @NonNull org.geotools.api.filter.Filter filter, @NonNull @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs, int pageSize)
  • Method Details

    • rawIterator

      public nz.org.riskscape.engine.relation.TupleIterator rawIterator()
      Specified by:
      rawIterator in class nz.org.riskscape.engine.relation.BaseRelation
    • getSourceInformation

      public String getSourceInformation()
    • clone

      protected nz.org.riskscape.engine.relation.BaseRelation clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields)
      Specified by:
      clone in class nz.org.riskscape.engine.relation.BaseRelation