Interface Relation
- All Superinterfaces:
AutoCloseable
,Realized
,SelfDescribingScalarData
- All Known Implementing Classes:
EmptyRelation
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<org.geotools.geometry.jts.ReferencedEnvelope>
long
getLimit()
long
default Type
Returns the RiskScape type that describes this data when extracted from a project and added in to a pipeline as a scalar value.default Optional<SpatialMetadata>
getType()
boolean
iterator()
default Relation
limit
(long newLimit) Convenience version oflimitAndOffset(long, long)
with offset set to the Relation's current offsetlimitAndOffset
(long newLimit, long newOffset) Returns a new relation that yields a subset of tuples this relation would normally return.default Relation
offset
(long newOffset) Convenience version oflimitAndOffset(long, long)
with limit set to the Relation's current limitproject
(Projection projection) restrict
(Restriction restriction) size()
Get a rough count of the untransformed tuples in the relation.skipInvalid
(ProblemSink sendProblemsTo) stream()
-
Method Details
-
getType
Struct getType() -
iterator
TupleIterator iterator() -
project
-
restrict
-
stream
-
getSpatialMetadata
- Returns:
SpatialMetadata
for this relation. Should returnOptional.empty()
if not a spatial layer.
-
skipInvalid
- Returns:
- a new relation that skips rows that are invalid for some reason TODO consider whether we need some sort of 'cloneWithOptions' method, that returns a new relation if the options are supported
-
hasSkipOnInvalid
boolean hasSkipOnInvalid()- Returns:
- true if invalid rows will be skipped for this relation
-
getSourceInformation
String getSourceInformation() -
calculateBounds
- Returns:
- a freshly computed ReferencedEnvelope for this relation which covers all of the geometry in the relation
identified by its
SpatialMetadata
, or empty if noSpatialMetadata
or for an emptyRelation
.
-
getLimit
long getLimit()- Returns:
- The maximum number of
Tuple
s this Relation will yield via an iterator it produces. If the underlying data set is not ordered, this could be a completely arbitrary set of results.
-
getOffset
long getOffset()- Returns:
- The number of
Tuple
s that will be skipped before an iterator starts yielding results. If the underlying data set is not ordered, this could be a completely arbitrary set of results.
-
limit
Convenience version of
limitAndOffset(long, long)
with offset set to the Relation's current offset -
offset
Convenience version of
limitAndOffset(long, long)
with limit set to the Relation's current limit -
limitAndOffset
Returns a new relation that yields a subset of tuples this relation would normally return. This should apply after any filtering that's applied to the relation, even if those filters are applied after a limit and offset.
- Returns:
- a new Relation with the limit and offset applied
-
getScalarDataType
Description copied from interface:SelfDescribingScalarData
Returns the RiskScape type that describes this data when extracted from a project and added in to a pipeline as a scalar value.
It is referred to as the scalar type to make it clear it's not the same as the
Type
of the data contained within it, e.g. theStruct
type of the relation (non-scalar) vsRelationType
that represents the relation itself (scalar).- Specified by:
getScalarDataType
in interfaceSelfDescribingScalarData
-
size
Get a rough count of the untransformed tuples in the relation. This may include tuples that are skipped because they are invalid or removed by a
filter
bookmark parameter. A rule of thumb is this should match the number of tuples produced byBaseRelation#rawIterator()
.- Returns:
- the number of tuples present in the underlying data (if easily known).
-