Package nz.org.riskscape.engine.relation
Class FeatureSourceTupleIterator
java.lang.Object
nz.org.riskscape.engine.relation.FeatureSourceTupleIterator
- All Implemented Interfaces:
AutoCloseable
,Iterator<nz.org.riskscape.engine.Tuple>
,nz.org.riskscape.engine.relation.TupleIterator
public class FeatureSourceTupleIterator
extends Object
implements nz.org.riskscape.engine.relation.TupleIterator
A TupleIterator
backed by a FeatureIterator
. Converts SimpleFeature
s to Tuple
s
on the fly according to the given type.
-
Field Summary
Modifier and TypeFieldDescriptionfinal org.geotools.feature.FeatureIterator<org.geotools.api.feature.simple.SimpleFeature>
final nz.org.riskscape.engine.types.Struct
Fields inherited from interface nz.org.riskscape.engine.relation.TupleIterator
EMPTY
-
Constructor Summary
ConstructorDescriptionFeatureSourceTupleIterator
(org.geotools.feature.FeatureIterator<org.geotools.api.feature.simple.SimpleFeature> iterator, nz.org.riskscape.engine.types.Struct type) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
static FeatureSourceTupleIterator
fromQuery
(@NonNull org.geotools.api.data.SimpleFeatureSource featureSource, @NonNull org.geotools.api.data.Query query, @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull nz.org.riskscape.engine.types.Struct type, @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) Creates a newFeatureSourceTupleIterator
nz.org.riskscape.engine.types.Struct
getType()
boolean
hasNext()
nz.org.riskscape.engine.Tuple
next()
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.relation.TupleIterator
collect, forEachRemaining
-
Field Details
-
internal
public final org.geotools.feature.FeatureIterator<org.geotools.api.feature.simple.SimpleFeature> internal -
type
public final nz.org.riskscape.engine.types.Struct type
-
-
Constructor Details
-
FeatureSourceTupleIterator
public FeatureSourceTupleIterator(org.geotools.feature.FeatureIterator<org.geotools.api.feature.simple.SimpleFeature> iterator, nz.org.riskscape.engine.types.Struct type)
-
-
Method Details
-
fromQuery
public static FeatureSourceTupleIterator fromQuery(@NonNull @NonNull org.geotools.api.data.SimpleFeatureSource featureSource, @NonNull @NonNull org.geotools.api.data.Query query, @NonNull @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull @NonNull nz.org.riskscape.engine.types.Struct type, @NonNull @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) Creates a new
FeatureSourceTupleIterator
- Parameters:
featureSource
- aFeatureSource
to pull features fromquery
- a query to use when building theSimpleFeatureIterator
.sridSet
- the sridset to use for mappingCoordinateReferenceSystem
s to SRID (Geometry.getSRID()
)type
- the struct thatTuple
s will use.- Returns:
- a new
FeatureSourceTupleIterator
-
hasNext
public boolean hasNext() -
next
public nz.org.riskscape.engine.Tuple next() -
finalize
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacenz.org.riskscape.engine.relation.TupleIterator
-
getType
public nz.org.riskscape.engine.types.Struct getType()
-