Package noaa.coastwatch.util
Class DataLocationConstraints
java.lang.Object
noaa.coastwatch.util.DataLocationConstraints
The
DataLocationConstraints
class holds a set of values
used to specify the bounds and sparseness of a continguous area of data
locations. The main purpose is to pass to the
DataLocationIteratorFactory
to create various types of iterators
over locations within the area. The class also has static methods useful
with polygons shapes.- Since:
- 3.3.2
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionint[]
The full data location dimensions.The data location start and end bounds.double
The data coverage fraction in the range [0..1].int
The data coverage minimum number of data locations.The polygon shape surrounding the locations.The data location start and end bounds.int[]
The data location stride in each data dimension. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
getShapeArea
(Shape shape) Gets the area of a shape.static DataLocation[]
getShapeBounds
(Shape shape) Gets the rectangular bounds of the specified shape in data location coordinates.
-
Field Details
-
dims
public int[] dimsThe full data location dimensions. -
start
The data location start and end bounds. These can be specified as an alternative to using the full bounds specified in dims. If either start or end is not specified, the bounds are taken from dims. -
end
The data location start and end bounds. These can be specified as an alternative to using the full bounds specified in dims. If either start or end is not specified, the bounds are taken from dims. -
polygon
The polygon shape surrounding the locations. The polygon can be specified as an alternative to the start and end bounds. The (x,y) coordinate values of each point in the polygon are taken to be the data location (row, column) values. -
fraction
public double fractionThe data coverage fraction in the range [0..1]. This is used to compute the stride if stride is not specified. If neither the data coverage fraction or the stride are specified, the start and end values are taken to be endpoints of a 1D line rather than an area. -
minCount
public int minCountThe data coverage minimum number of data locations. This is used to compute the stride in combination with the fraction. -
stride
public int[] strideThe data location stride in each data dimension. If specified, this stride overrides anything specified by the fraction and minCount.
-
-
Constructor Details
-
DataLocationConstraints
public DataLocationConstraints()
-
-
Method Details
-
getShapeBounds
Gets the rectangular bounds of the specified shape in data location coordinates.- Parameters:
shape
- the shape to get the bounds for.- Returns:
- the bounds as [min, max] data locations or null if the shape has no area.
-
getShapeArea
Gets the area of a shape.- Parameters:
shape
- the shape to get the area for.- Returns:
- the shape area as a fractional value in the range [0..1] where 1 means that the shape fills up the entire rectangle enclosed by its bounds.
-