Package nz.org.riskscape.engine.relation
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 FeatureStore
s 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 FeatureSource
s 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
ModifierConstructorDescriptionPagingFeatureSourceRelation
(@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) Create aPagingFeatureSourceRelation
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 TypeMethodDescriptionprotected 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) Create a
PagingFeatureSourceRelation
- Parameters:
type
- the type as perRelation.getType()
featureSource
- theFeatureSource
to page fromsridSet
- used for constructingGeometry
s with the correct sridfilter
- a filter to apply to features in theFeatureSource
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 classnz.org.riskscape.engine.relation.BaseRelation
-
getSourceInformation
-
clone
protected nz.org.riskscape.engine.relation.BaseRelation clone(nz.org.riskscape.engine.relation.BaseRelation.Fields fields) - Specified by:
clone
in classnz.org.riskscape.engine.relation.BaseRelation
-