Package org.geotools.imageio.netcdf.slice
Query objects into NetCDF dimension selections and, ultimately, into readable 2D
slices.
Queries containing time, elevation, and additional dimensions must be translated into ImageIO imageIndex
values, each representing a 2D slice of the underlying NetCDF variable. These imageIndex values are then
resolved into the corresponding NetCDF multidimensional indices (time, elevation, and other dimensions), allowing the
reader to access the correct portion of the NetCDF data.
The code in this package is organized around a staged pipeline:
- A GeoTools filter is analyzed and split into:
- dimension-backed predicates that can be resolved directly against NetCDF axes
- a residual post-filter that must still be evaluated in memory on produced features
- The recognized dimension predicates are translated into
DimensionFilterinstances for time, elevation, and additional dimensions. - Those dimension filters are resolved to concrete NetCDF axis indices by consulting per-variable lookup structures built from underlying NetCDF coordinate variables.
- The matching logical dimension tuples are iterated, converted to NetCDF split indices, mapped to image indexes,
and exposed as
CoverageSlices.
Filter splitting and translation
See the filter portion of the package for the logic that walks the original GeoTools filter tree using the
DimensionFilterSplitter.
NetCDFDimensionBindingResolver centralizes the mapping between feature
attributes and NetCDF logical dimensions by answering which attribute corresponds to time, elevation, or a given
additional dimension.
Slice query planning and execution
The slice portion of the package turns the split result into actual slice iteration:
NetCDFSliceProvideris theCoverageSlicesCatalog.SliceProviderimplementation for a single NetCDF variable. It is the main runtime bridge betweenCoverageSlicesCatalogqueries and NetCDF slice access.NetCDFSliceQueryis the preprocessed query representation. It stores the recognized dimension filters and the residual post-filter, and prepares the logical dimension domain to iterate.NetCDFSliceIteratoriterates the cartesian product of the selected dimension indices, builds the corresponding features, and applies the residual post-filter when needed.NetCDFImageIndexResolverresolves a global image index into the owning variable and its logical non-spatial dimension indices, allowing the reader to move between flattened image indexes and multidimensional NetCDF coordinates.NetCDFDimensionIndexesbuilds and exposes lookup structures for temporal, elevation, and additional dimensions. It provides regular-axis and array-backed implementations, exact-match support, and lower/upper bound search methods used by range filters.DimensionFilterIndexResolvertakes aDimensionFiltertogether with one of the lookup types fromNetCDFDimensionIndexesand resolves it into the exact set of matching axis indices.
Class interactions
The main interaction flow is:
Query -> NetCDFSliceProvider (query) -> NetCDFSliceQuery -> DimensionFilterSplitter -> SplitFilterResult -> NetCDFSliceQuery.toDomain(...) -> DimensionFilterIndexResolver -> NetCDFDimensionIndexes lookup objects -> NetCDFSliceIterator -> CoverageSlice / SimpleFeature
-
ClassDescriptionResolves schema attribute names to logical dimensions (time, elevation, additional).Represents a binding between a schema attribute and a NetCDF logical dimension.Resolves
DimensionFilterinstances into concrete axis index selections.Resolves schema attribute names to NetCDF logical dimensions (time, elevation, additional).Dimension indexes and lookup helpers used to resolve NetCDF slice dimensions from domain values.Array-backed numeric lookup for irregular numeric axes.Array-backed time lookup for irregular temporal axes.Base contract for a dimension axis lookup.Lookup interface for numeric axes such as elevation or additional numeric dimensions.Regular numeric axis lookup backed by size, start, and step.Regular time axis lookup backed by size, start, and step.Lookup interface for temporal axes such as the TIME dimension.ACoverageSlicesCatalog.SliceProviderimplementation that exposes the slices of a single NetCDF variable as queryable catalog entries.Associates an additional domain with its attribute name and logical dimension index.Per-variable context holding the available dimension lookups.