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 SimpleFeatures to Tuples on the fly according to the given type.

  • Field Summary

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

    Constructors
    Constructor
    Description
    FeatureSourceTupleIterator(org.geotools.feature.FeatureIterator<org.geotools.api.feature.simple.SimpleFeature> iterator, nz.org.riskscape.engine.types.Struct type)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    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)
    nz.org.riskscape.engine.types.Struct
     
    boolean
     
    nz.org.riskscape.engine.Tuple
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface java.util.Iterator

    remove

    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)
      Parameters:
      featureSource - a FeatureSource to pull features from
      query - a query to use when building the SimpleFeatureIterator.
      sridSet - the sridset to use for mapping CoordinateReferenceSystems to SRID (Geometry.getSRID())
      type - the struct that Tuples will use.
      Returns:
      a new FeatureSourceTupleIterator
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<nz.org.riskscape.engine.Tuple>
    • next

      public nz.org.riskscape.engine.Tuple next()
      Specified by:
      next in interface Iterator<nz.org.riskscape.engine.Tuple>
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface nz.org.riskscape.engine.relation.TupleIterator
    • getType

      public nz.org.riskscape.engine.types.Struct getType()