Package org.apache.sis.storage.aggregate
Class GroupByTransform
A container for a list of slices grouped by their "grid to CRS" transform, ignoring integer translations.
- Since:
- 1.3
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GridGeometry
Geometry of the grid coverage or resource.private final org.opengis.referencing.operation.MathTransform
Value orgeometry.getGridToCRS(PixelInCell.CELL_CORNER)
.(package private) MergeStrategy
Algorithm to apply when more than one grid coverage can be found at the same grid index. -
Constructor Summary
ConstructorsConstructorDescriptionGroupByTransform
(GridGeometry geometry, org.opengis.referencing.operation.MathTransform gridToCRS, MergeStrategy strategy) Creates a new group of objects associated to the given transform. -
Method Summary
Modifier and TypeMethodDescription(package private) final String
createName
(Locale locale) Returns a name for this group.(package private) final Resource
createResource
(StoreListeners parentListeners, List<SampleDimension> ranges) Sorts the slices in increasing order of low grid coordinates in the concatenated dimension.private int[]
Returns dimensions to aggregate, in order of recommendation.(package private) final org.opengis.referencing.operation.Matrix
linearTransform
(org.opengis.referencing.operation.MathTransform crsToGrid) Returns the conversion of pixel coordinates from this group to a slice if that conversion is linear.Methods inherited from class org.apache.sis.storage.aggregate.Group
getName, prepareAggregate, toString
-
Field Details
-
geometry
Geometry of the grid coverage or resource. This is copied from the firstGridSlice.geometry
found in iteration order for this group. It may be a somewhat random grid geometry, unlessGridSlice
instances are sorted before processing. -
gridToCRS
private final org.opengis.referencing.operation.MathTransform gridToCRSValue orgeometry.getGridToCRS(PixelInCell.CELL_CORNER)
. All Group.members of this group use this transform, possibly with integer differences in translation terms. -
strategy
MergeStrategy strategyAlgorithm to apply when more than one grid coverage can be found at the same grid index. This is set at construction time and usually keep the same value after that point, unlessCoverageAggregator.setMergeStrategy(MergeStrategy)
is invoked again.
-
-
Constructor Details
-
GroupByTransform
GroupByTransform(GridGeometry geometry, org.opengis.referencing.operation.MathTransform gridToCRS, MergeStrategy strategy) Creates a new group of objects associated to the given transform.- Parameters:
geometry
- geometry of the grid coverage or resource.gridToCRS
- value orgeometry.getGridToCRS(PixelInCell.CELL_CORNER)
.strategy
- algorithm to apply when more than one grid coverage can be found at the same grid index.
-
-
Method Details
-
createName
Returns a name for this group. This is used as the resource name if an aggregated resource needs to be created. Current implementation assumes that the main reason why many groups may exist is that they differ by their resolution.- Specified by:
createName
in classGroup<GridSlice>
- Parameters:
locale
- the locale for the name to return, ornull
for the default.- Returns:
- a name which can be used as aggregation name.
-
linearTransform
final org.opengis.referencing.operation.Matrix linearTransform(org.opengis.referencing.operation.MathTransform crsToGrid) Returns the conversion of pixel coordinates from this group to a slice if that conversion is linear.- Parameters:
crsToGrid
- the "CRS to slice" transform.- Returns:
- the conversion as an affine transform, or
null
if null or if the conversion is non-linear.
-
findConcatenatedDimensions
private int[] findConcatenatedDimensions()Returns dimensions to aggregate, in order of recommendation. Aggregations should use the first dimension in the returned list. -
createResource
Sorts the slices in increasing order of low grid coordinates in the concatenated dimension. Then builds a concatenated grid coverage resource capable to perform binary searches along that dimension.- Parameters:
parentListeners
- listeners of the parent resource, ornull
if none.sampleDimensions
- the sample dimensions of the resource to build.- Returns:
- the concatenated resource.
-