Class GroupByTransform

java.lang.Object
org.apache.sis.storage.aggregate.Group<GridSlice>
org.apache.sis.storage.aggregate.GroupByTransform

final class GroupByTransform extends Group<GridSlice>
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

    Fields
    Modifier and Type
    Field
    Description
    private final GridGeometry
    Geometry of the grid coverage or resource.
    private final org.opengis.referencing.operation.MathTransform
    Value or geometry.getGridToCRS(PixelInCell.CELL_CORNER).
    (package private) MergeStrategy
    Algorithm to apply when more than one grid coverage can be found at the same grid index.

    Fields inherited from class org.apache.sis.storage.aggregate.Group

    members
  • Constructor Summary

    Constructors
    Constructor
    Description
    GroupByTransform(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 Type
    Method
    Description
    (package private) final String
    Returns a name for this group.
    (package private) final Resource
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • geometry

      private final GridGeometry geometry
      Geometry of the grid coverage or resource. This is copied from the first GridSlice.geometry found in iteration order for this group. It may be a somewhat random grid geometry, unless GridSlice instances are sorted before processing.
    • gridToCRS

      private final org.opengis.referencing.operation.MathTransform gridToCRS
      Value or geometry.getGridToCRS(PixelInCell.CELL_CORNER). All Group.members of this group use this transform, possibly with integer differences in translation terms.
    • strategy

      MergeStrategy strategy
      Algorithm 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, unless CoverageAggregator.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 or geometry.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

      final String createName(Locale locale)
      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 class Group<GridSlice>
      Parameters:
      locale - the locale for the name to return, or null 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

      final Resource createResource(StoreListeners parentListeners, List<SampleDimension> ranges)
      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, or null if none.
      sampleDimensions - the sample dimensions of the resource to build.
      Returns:
      the concatenated resource.