Package nz.org.riskscape.engine.relation
Class FeatureSourceRelation
java.lang.Object
nz.org.riskscape.engine.relation.BaseRelation
nz.org.riskscape.engine.relation.FeatureSourceRelation
- All Implemented Interfaces:
AutoCloseable
,nz.org.riskscape.engine.data.SelfDescribingScalarData
,nz.org.riskscape.engine.pipeline.Realized
,nz.org.riskscape.engine.relation.Relation
public class FeatureSourceRelation
extends nz.org.riskscape.engine.relation.BaseRelation
Provides a stream of Tuple
s based on a SimpleFeatureSource
-
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
Modifier and TypeFieldDescriptionprotected final org.geotools.api.referencing.crs.CoordinateReferenceSystem
static final String
Name of tuple member that identifies the value ofSimpleFeature.getID()
static final nz.org.riskscape.engine.types.Type
Special instance of Text type used to identify feature id - makes it easier to treat it speciallyFields inherited from class nz.org.riskscape.engine.relation.BaseRelation
skipOnInvalid, transformers
-
Constructor Summary
ModifierConstructorDescriptionprotected
FeatureSourceRelation
(nz.org.riskscape.engine.relation.BaseRelation.Fields clonedFields, @NonNull org.geotools.api.data.SimpleFeatureSource fs, @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull org.geotools.api.filter.Filter filter, @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) FeatureSourceRelation
(@NonNull nz.org.riskscape.engine.types.Struct type, @NonNull org.geotools.api.data.SimpleFeatureSource fs, @NonNull nz.org.riskscape.engine.SRIDSet sridSet, @NonNull org.geotools.api.filter.Filter filter, @NonNull org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) FeatureSourceRelation
(@NonNull nz.org.riskscape.engine.types.Struct type, @NonNull org.geotools.api.data.SimpleFeatureSource fs, @NonNull nz.org.riskscape.engine.SRIDSet sridSet, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) FeatureSourceRelation
(org.geotools.api.data.SimpleFeatureSource fs, nz.org.riskscape.engine.SRIDSet sridSet, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) -
Method Summary
Modifier and TypeMethodDescriptionprotected nz.org.riskscape.engine.relation.BaseRelation
clone
(nz.org.riskscape.engine.relation.BaseRelation.Fields fields) protected nz.org.riskscape.engine.relation.BaseRelation
cloneWithRestrictionIfSupported
(nz.org.riskscape.engine.restriction.Restriction restriction) static nz.org.riskscape.engine.types.Struct
fromFeatureSource
(org.geotools.api.data.SimpleFeatureSource fs, boolean includeFid) Infer a struct from the given FeatureSource TODO should we be passing in the CRS here? We have the potential to scrape a different CRS for our referenced value compared to the one that gets passed in to the spatial metadatastatic nz.org.riskscape.engine.types.Struct
fromFeatureType
(org.geotools.api.feature.simple.SimpleFeatureType type, org.geotools.geometry.jts.ReferencedEnvelope bounds, boolean includeFid) Infer a struct from the given SimpleFeatureTypestatic nz.org.riskscape.engine.types.Struct.StructMember
geometryStructMember
(nz.org.riskscape.engine.types.Struct struct, org.geotools.api.feature.simple.SimpleFeatureType schema) @NonNull org.geotools.api.data.SimpleFeatureSource
@NonNull org.geotools.api.filter.Filter
@NonNull nz.org.riskscape.engine.SRIDSet
size()
static nz.org.riskscape.engine.relation.SpatialMetadata
spatialMetadataFromSchema
(nz.org.riskscape.engine.types.Struct struct, org.geotools.api.feature.simple.SimpleFeatureType schema, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) Methods inherited from class nz.org.riskscape.engine.relation.BaseRelation
cloneWithProjectionIfSupported, cloneWithTransformer, getLimit, getOffset, getProducedType, getRawType, getSpatialMetadata, 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, getType, limit, offset, stream, toTupleInput
-
Field Details
-
FID_MEMBER_NAME
Name of tuple member that identifies the value of
SimpleFeature.getID()
- See Also:
-
FID_TYPE
public static final nz.org.riskscape.engine.types.Type FID_TYPESpecial instance of Text type used to identify feature id - makes it easier to treat it specially
-
crs
protected final org.geotools.api.referencing.crs.CoordinateReferenceSystem crs
-
-
Constructor Details
-
FeatureSourceRelation
public FeatureSourceRelation(org.geotools.api.data.SimpleFeatureSource fs, nz.org.riskscape.engine.SRIDSet sridSet, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) -
FeatureSourceRelation
public FeatureSourceRelation(@NonNull @NonNull nz.org.riskscape.engine.types.Struct type, @NonNull @NonNull org.geotools.api.data.SimpleFeatureSource fs, @NonNull @NonNull nz.org.riskscape.engine.SRIDSet sridSet, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) -
FeatureSourceRelation
public FeatureSourceRelation(@NonNull @NonNull nz.org.riskscape.engine.types.Struct type, @NonNull @NonNull org.geotools.api.data.SimpleFeatureSource fs, @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) -
FeatureSourceRelation
protected FeatureSourceRelation(@NonNull nz.org.riskscape.engine.relation.BaseRelation.Fields clonedFields, @NonNull @NonNull org.geotools.api.data.SimpleFeatureSource fs, @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)
-
-
Method Details
-
fromFeatureSource
public static nz.org.riskscape.engine.types.Struct fromFeatureSource(org.geotools.api.data.SimpleFeatureSource fs, boolean includeFid) Infer a struct from the given FeatureSource TODO should we be passing in the CRS here? We have the potential to scrape a different CRS for our referenced value compared to the one that gets passed in to the spatial metadata
- Parameters:
fs
- a feature source to build aStruct
fromincludeFid
- if true, a special_fid
member is added to the type which holds the value ofSimpleFeature.getID()
.
-
fromFeatureType
public static nz.org.riskscape.engine.types.Struct fromFeatureType(org.geotools.api.feature.simple.SimpleFeatureType type, org.geotools.geometry.jts.ReferencedEnvelope bounds, boolean includeFid) Infer a struct from the given SimpleFeatureType
- Parameters:
type
- a feature type to build aStruct
frombounds
- the geometric bounds if known (else null)includeFid
- if true, a special_fid
member is added to the type which holds the value ofSimpleFeature.getID()
.
-
geometryStructMember
public static nz.org.riskscape.engine.types.Struct.StructMember geometryStructMember(nz.org.riskscape.engine.types.Struct struct, org.geotools.api.feature.simple.SimpleFeatureType schema) - Returns:
- the StructMember in the given struct the corresponds to the feature's geometry
-
spatialMetadataFromSchema
public static nz.org.riskscape.engine.relation.SpatialMetadata spatialMetadataFromSchema(nz.org.riskscape.engine.types.Struct struct, org.geotools.api.feature.simple.SimpleFeatureType schema, org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) -
rawIterator
- Specified by:
rawIterator
in classnz.org.riskscape.engine.relation.BaseRelation
-
getSourceInformation
-
cloneWithRestrictionIfSupported
protected nz.org.riskscape.engine.relation.BaseRelation cloneWithRestrictionIfSupported(nz.org.riskscape.engine.restriction.Restriction restriction) - Overrides:
cloneWithRestrictionIfSupported
in classnz.org.riskscape.engine.relation.BaseRelation
-
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
-
size
-
getSridSet
@NonNull public @NonNull nz.org.riskscape.engine.SRIDSet getSridSet() -
getFeatureSource
@NonNull public @NonNull org.geotools.api.data.SimpleFeatureSource getFeatureSource() -
getFilter
@NonNull public @NonNull org.geotools.api.filter.Filter getFilter()
-