Class MultiCoverage
java.lang.Object
nz.org.riskscape.defaults.function.MultiCoverage
- All Implemented Interfaces:
nz.org.riskscape.engine.coverage.TypedCoverage,nz.org.riskscape.engine.data.SelfDescribingScalarData
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface for an object that can set raw values with the result of evaluating a coverage.Nested classes/interfaces inherited from interface nz.org.riskscape.engine.coverage.TypedCoverage
nz.org.riskscape.engine.coverage.TypedCoverage.Empty -
Field Summary
Fields inherited from interface nz.org.riskscape.engine.coverage.TypedCoverage
DEFAULT_CRS -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiCoveragecreate(nz.org.riskscape.engine.types.Struct type, nz.org.riskscape.engine.coverage.TypedCoverage[] coverages, MultiCoverage.RawValueSetter[] valueSetters, nz.org.riskscape.engine.SRIDSet sridSet, BiFunction<org.locationtech.jts.geom.Geometry, org.locationtech.jts.geom.Point, List<org.locationtech.jts.geom.Geometry>> cutFunction) Creates a new MultiCoverage that yields the given structtypeby sampling all of the coverages and setting those to type.evaluate(org.locationtech.jts.geom.Point point) org.geotools.api.referencing.crs.CoordinateReferenceSystemOptional<org.geotools.geometry.jts.ReferencedEnvelope>Optional<Function<org.locationtech.jts.geom.Geometry,List<nz.org.riskscape.engine.util.Pair<org.locationtech.jts.geom.Geometry, Object>>>> This samples each of the coverages the MultiCoverage contains individually, and then returns the combined result.nz.org.riskscape.engine.types.StructgetType()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nz.org.riskscape.engine.coverage.TypedCoverage
asRelation, getScalarDataType
-
Method Details
-
create
public static MultiCoverage create(nz.org.riskscape.engine.types.Struct type, nz.org.riskscape.engine.coverage.TypedCoverage[] coverages, MultiCoverage.RawValueSetter[] valueSetters, nz.org.riskscape.engine.SRIDSet sridSet, BiFunction<org.locationtech.jts.geom.Geometry, org.locationtech.jts.geom.Point, List<org.locationtech.jts.geom.Geometry>> cutFunction) Creates a new MultiCoverage that yields the given struct
typeby sampling all of the coverages and setting those to type. Each member of the type must correspond to a coverage.- Parameters:
type- the type to be returned from the coveragecoverages- the coverages that make up the multi coveragevalueSetters- to evaluate the coverage and set the results in the appropriate positions of the tuples raw results (as given by #type)cutFunction- a function that can cut a given geometry into smaller pieces for sampling the coverages. Used bygetEvaluateIntersectionOp().
-
evaluate
- Specified by:
evaluatein interfacenz.org.riskscape.engine.coverage.TypedCoverage
-
getEvaluateIntersectionOp
public Optional<Function<org.locationtech.jts.geom.Geometry,List<nz.org.riskscape.engine.util.Pair<org.locationtech.jts.geom.Geometry, getEvaluateIntersectionOp()Object>>>> This samples each of the coverages the MultiCoverage contains individually, and then returns the combined result. When evaluating intersections, the input geometry is cut into pieces (i.e. grid segments), and the centre of each piece is sampled individually. It is important to note that we only ever use
TypedCoverage.evaluate(Point)to sample each individual coverage, even if the coverage is aSpatialRelationTypedCoverage.- Specified by:
getEvaluateIntersectionOpin interfacenz.org.riskscape.engine.coverage.TypedCoverage
-
getCoordinateReferenceSystem
public org.geotools.api.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()- Specified by:
getCoordinateReferenceSystemin interfacenz.org.riskscape.engine.coverage.TypedCoverage
-
getEnvelope
- Specified by:
getEnvelopein interfacenz.org.riskscape.engine.coverage.TypedCoverage
-
toString
-
getCoveragesAsMap
-
getType
public nz.org.riskscape.engine.types.Struct getType()- Specified by:
getTypein interfacenz.org.riskscape.engine.coverage.TypedCoverage
-