Package org.apache.sis.coverage.grid
Class DimensionReducer
java.lang.Object
org.apache.sis.coverage.grid.DimensionReducer
An helper class for reducing the number of dimensions in a grid geometry, an envelope or a position.
This is used when the Area Of Interest has more dimensions than the grid geometry, in which case the
transform from grid to AOI will fail if we do not discard the extra dimensions.
- Since:
- 1.1
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]
The dimensions to keep, ornull
for keeping them all.private org.opengis.referencing.crs.CoordinateReferenceSystem
The CRS with only the dimensions to keep, ornull
if no reduction. -
Constructor Summary
ConstructorsConstructorDescriptionDimensionReducer
(GridGeometry base, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS) Creates an helper which will retain only thetargetCRS
dimensions that are found the the base grid. -
Method Summary
Modifier and TypeMethodDescription(package private) final org.opengis.geometry.DirectPosition
apply
(org.opengis.geometry.DirectPosition target) Applies reduction on the given position.(package private) final org.opengis.geometry.Envelope
apply
(org.opengis.geometry.Envelope target) Applies reduction on the given envelope.
-
Field Details
-
dimensions
private int[] dimensionsThe dimensions to keep, ornull
for keeping them all. -
reducedCRS
private org.opengis.referencing.crs.CoordinateReferenceSystem reducedCRSThe CRS with only the dimensions to keep, ornull
if no reduction.
-
-
Constructor Details
-
DimensionReducer
DimensionReducer(GridGeometry base, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS) throws org.opengis.util.FactoryException Creates an helper which will retain only thetargetCRS
dimensions that are found the the base grid. This will be used by caller for creating a validsourceCRS
totargetCRS
transform.- Parameters:
base
- the grid geometry which will be derived. Cannot be null.targetCRS
- CRS of the area or point of interest. Cannot be null.- Throws:
org.opengis.util.FactoryException
-
-
Method Details
-
apply
final org.opengis.geometry.DirectPosition apply(org.opengis.geometry.DirectPosition target) Applies reduction on the given position. If the position cannot be reduced, then it is returned as-is. -
apply
final org.opengis.geometry.Envelope apply(org.opengis.geometry.Envelope target) Applies reduction on the given envelope. If the envelope cannot be reduced, then it is returned as-is.
-