public final class DiscreteReferencingFactory extends Static
DiscreteCoordinateSystemAxis
and derived objects.
Every createXXX(...)
methods provided in this class wrap an existing referencing
object and add discrete behavior to it.
IMPORTANT NOTE:
In current implementation, every factory methods defined in this class do not
clone the given ordinate arrays, because those arrays may be potentially large and the caller
way want to share the reference to some of them. It is caller responsibility to not change
the ordinate arrays after they have been passed to factory methods.
Defined in the geotkcoverage
module
Modifier and Type  Method and Description 

static DiscreteCoordinateSystemAxis<?> 
createDiscreteAxis(CoordinateSystemAxis axis,
double... ordinates)
Creates a new discrete axis wrapping the given axis with the given ordinate values.

static CoordinateReferenceSystem 
createDiscreteCRS(CoordinateReferenceSystem crs,
double[]... ordinates)
Returns a CRS instance wrapping the given CRS with the given ordinate values for each axis.

static CoordinateSystem 
createDiscreteCS(CoordinateSystem cs,
double[]... ordinates)
Returns a CS instance wrapping the given CS with the given ordinate values for each axis.

static Matrix 
getAffineTransform(CoordinateReferenceSystem crs)
Computes a grid to CRS affine transform for the given CRS, mapping
cell center.

static Matrix 
getAffineTransform(DiscreteCoordinateSystemAxis<?>... axes)
Computes a grid to CRS affine transform for the given axes, mapping
cell center.

static Matrix 
getAffineTransform(GridGeometry geometry,
PixelInCell pixelInCell)
Returns the grid to CRS affine transform for the given grid geometry.

public static DiscreteCoordinateSystemAxis<?> createDiscreteAxis(CoordinateSystemAxis axis, double... ordinates)
DiscreteCoordinateSystemAxis
having
the given ordinates values (or the ordinates array is null
), then that instance
is returned directly.axis
 The axis to wrap.ordinates
 The ordinate values. This array is not cloned.public static CoordinateSystem createDiscreteCS(CoordinateSystem cs, double[]... ordinates) throws IllegalArgumentException
GridGeometry
interface. However
the grid to CRS transform is meaningful only if the ordinate values in the given
arrays are regularly spaced. This is not verified because the criterion for deciding if an
axis is "regular" is arbitrary.cs
 The coordinate system to wrap.ordinates
 The ordinate values for each axis. The arrays are not cloned.IllegalArgumentException
 If the length of the ordinates
array is not equals
to the dimension of the given coordinate
system.public static CoordinateReferenceSystem createDiscreteCRS(CoordinateReferenceSystem crs, double[]... ordinates) throws IllegalArgumentException
GridGeometry
interface. However
the grid to CRS transform is meaningful only if the ordinate values in the given
arrays are regularly spaced. This is not verified because the criterion for deciding if an
axis is "regular" is arbitrary.crs
 The coordinate reference system to wrap.ordinates
 The ordinate values for each axis. The arrays are not cloned.IllegalArgumentException
 If the length of the ordinates
array is not equals
to the coordinate system dimension.public static Matrix getAffineTransform(DiscreteCoordinateSystemAxis<?>... axes)
NaN
values.axes
 The axes to use for computing the transform.null
if such matrix can not be computed.public static Matrix getAffineTransform(CoordinateReferenceSystem crs)
GridGeometry
interface, then this method
checks the value returned by the GridGeometry.getGridToCRS()
method. If
that value is a linear transform, then its matrix is returned.CompoundCRS
, then the above
check is performed for each component and
the component matrix are assembled in a single matrix.getAffineTransform(DiscreteCoordinateSystemAxis[])
method.
Note that the conditions documented in the above method apply.null
.crs
 The Coordinate Reference System for which to get the grid to CRS
affine transform.null
if such matrix can not be computed.public static Matrix getAffineTransform(GridGeometry geometry, PixelInCell pixelInCell)
getGridToCRS()
methods:
GeneralGridGeometry.getGridToCRS(PixelInCell)
if the given grid geometry
is a compatible instance and the pixelInCell
argument is nonnull;GridGeometry.getGridToCRS()
otherwise. This later method shall implicitly
use PixelInCell.CELL_CENTER
as per OGC 01004 specification, but departure
is possible if the user has overridden the method.NetcdfCRS
), then this method performs
the same calculation than getAffineTransform(CoordinateReferenceSystem)
.null
.geometry
 The geometry for which to get the grid to CRS affine transform.pixelInCell
 Whatever the transform should map the cell center or corner, or null
for the default (typically cell center).null
if such matrix can not be computed.GeneralGridGeometry.getGridToCRS(PixelInCell)
,
PixelTranslation
Copyright © 2009–2017 Geotoolkit.org. All rights reserved.