Object
RegionOfInterest
- All Implemented Interfaces:
Serializable
,LenientComparable
Region of interest (ROI) for an operation to apply on a coverage.
Multi-threading
Instances ofRegionOfInterest
are immutable and thread-safe.
Limitations
Current implementation supports two-dimensional regions only. This restriction will be relaxed progressively in future versions.Current implementation defines ROI using a geometric shape only. Future versions may allow other ways such as mask rasters.
- Since:
- 1.2
- See Also:
-
Constructor Summary
ConstructorDescriptionRegionOfInterest
(Shape geometry, CoordinateReferenceSystem crs) Creates a new region of interest from a two-dimensional shape. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Compares this region of interest with the given object for equality.boolean
equals
(Object other, ComparisonMode mode) Compares this region of interest with the given object for equality.int
Returns a hash code value for this region of interest.toShape2D
(GridGeometry target) Returns the clip geometry in coordinates of grid cells.
-
Constructor Details
-
RegionOfInterest
Creates a new region of interest from a two-dimensional shape. If the given CRS isnull
, then it will be assumed the same CRS than the CRS of the coverage on which operations are applied.- Parameters:
geometry
- the ROI as a geometry. Coordinates are in the CRS given bycrs
.crs
- coordinate reference system of the region of interest, ornull
.
-
-
Method Details
-
toShape2D
Returns the clip geometry in coordinates of grid cells. The target space is specified by aGridGeometry
.Limitations
In current implementation, the grid geometry most be two-dimensional. This restriction will be relaxed progressively in future versions.- Parameters:
target
- two-dimensional grid geometry of the target image.- Returns:
- clip in pixel coordinates of given grid.
- Throws:
TransformException
- if ROI coordinates cannot be transformed to grid coordinates.
-
equals
Compares this region of interest with the given object for equality.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classObject
- Parameters:
other
- the other object to compare with this ROI.- Returns:
- whether the given object is equal to this ROI?
- See Also:
-
equals
Compares this region of interest with the given object for equality.- Specified by:
equals
in interfaceLenientComparable
- Parameters:
other
- the other object to compare with this ROI.mode
- the comparison criterion.- Returns:
- whether the given object is equal to this ROI?
- See Also:
-
hashCode
public int hashCode()Returns a hash code value for this region of interest.
-