Class CoverageValueProviderHelper
java.lang.Object
nz.org.riskscape.engine.data.coverage.CoverageValueProviderHelper
Provides utility functions useful to TypedCoverage
implementations.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Exception to throw if the helper is given an empty geometry. -
Constructor Summary
ConstructorDescriptionCoverageValueProviderHelper
(org.geotools.geometry.jts.ReferencedEnvelope envelope, nz.org.riskscape.engine.SRIDSet sridSet) Get a helper for a coverage that covers the envelope. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(org.geotools.api.geometry.Position position) org.geotools.geometry.jts.ReferencedEnvelope
org.geotools.api.geometry.Position
pointToDirectPosition
(org.locationtech.jts.geom.Point point) org.locationtech.jts.geom.Geometry
reprojectIfNecessary
(org.locationtech.jts.geom.Geometry geom) Will reproject geom into theCoordinateReferenceSystem
of the coverage if necessary.
-
Constructor Details
-
CoverageValueProviderHelper
public CoverageValueProviderHelper(org.geotools.geometry.jts.ReferencedEnvelope envelope, nz.org.riskscape.engine.SRIDSet sridSet) Get a helper for a coverage that covers the envelope.
- Parameters:
envelope
- containing the coveragesridSet
-
-
-
Method Details
-
reprojectIfNecessary
public org.locationtech.jts.geom.Geometry reprojectIfNecessary(org.locationtech.jts.geom.Geometry geom) throws CoverageValueProviderHelper.EmptyGeometryException Will reproject geom into the
CoordinateReferenceSystem
of the coverage if necessary.- Parameters:
geom
-- Returns:
- geom, or reproject geom if necessary
- Throws:
CoverageValueProviderHelper.EmptyGeometryException
- if geom is empty
-
contains
public boolean contains(org.geotools.api.geometry.Position position) - Parameters:
position
-- Returns:
- true if position is within the envelope
-
pointToDirectPosition
public org.geotools.api.geometry.Position pointToDirectPosition(org.locationtech.jts.geom.Point point) -
getEnvelope
public org.geotools.geometry.jts.ReferencedEnvelope getEnvelope()
-