Package org.apache.sis.coverage.grid
Class GridExtentCRS
java.lang.Object
org.apache.sis.coverage.grid.GridExtentCRS
Builder for coordinate reference system which is derived from the coverage CRS by the inverse
of the "grid to CRS" transform. Those CRS describe coordinates associated to the grid extent.
This class provides two factory methods:
#forCoverage(String, GridGeometry)
forExtentAlone(Matrix, DimensionNameType[])
- Since:
- 1.0
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
Name of the parameter specifying the way image indices are associated with the coverage data attributes.private static final NamedIdentifier
Name of the coordinate systems created by this class.private static final org.opengis.referencing.operation.OperationMethod
Description of "CRS to grid indices" operation method.private static final String
Name of the parameter where to store the grid coverage name.private static final org.opengis.util.InternationalString
Scope of usage of the CRS. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
abbreviation
(int dimension) Returns a default axis abbreviation for the given dimension.private static org.opengis.referencing.cs.CoordinateSystemAxis
axis
(org.opengis.referencing.cs.CSFactory csFactory, String name, String abbreviation, org.opengis.referencing.cs.AxisDirection direction) Creates a coordinate system axis of the given name.private static org.opengis.referencing.cs.CoordinateSystem
createCS
(int tgtDim, org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types, Locale locale) Creates the coordinate system for engineering CRS.(package private) static org.opengis.referencing.crs.DerivedCRS
forCoverage
(String name, GridGeometry gg, org.opengis.referencing.datum.PixelInCell anchor, Locale locale) Creates a derived CRS for the grid extent of a grid coverage.(package private) static org.opengis.referencing.crs.EngineeringCRS
forExtentAlone
(org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types) Builds the engineering coordinate reference system of aGridExtent
.properties
(Object name) Creates a properties map to give to CS, CRS or datum constructors.private static org.opengis.util.FactoryException
unsupported
(Locale locale, org.opengis.referencing.crs.CoordinateReferenceSystem crs) Returns the exception to throw for an unsupported CRS.
-
Field Details
-
NAME_PARAM
Name of the parameter where to store the grid coverage name.- See Also:
-
ANCHOR_PARAM
Name of the parameter specifying the way image indices are associated with the coverage data attributes.- See Also:
-
METHOD
private static final org.opengis.referencing.operation.OperationMethod METHODDescription of "CRS to grid indices" operation method. -
SCOPE
private static final org.opengis.util.InternationalString SCOPEScope of usage of the CRS. This is a localized text saying "Conversions from coverage CRS to grid cell indices." -
CS_NAME
Name of the coordinate systems created by this class.
-
-
Constructor Details
-
GridExtentCRS
private GridExtentCRS()Do not allow instantiation of this class.
-
-
Method Details
-
forCoverage
static org.opengis.referencing.crs.DerivedCRS forCoverage(String name, GridGeometry gg, org.opengis.referencing.datum.PixelInCell anchor, Locale locale) throws org.opengis.util.FactoryException, org.opengis.referencing.operation.NoninvertibleTransformException Creates a derived CRS for the grid extent of a grid coverage.Limitation
If the CRS is compound, then this method takes only the first single CRS element. This is a restriction imposed byDerivedCRS
API. As a result, the returned CRS may cover only the 2 or 3 first grid dimensions.- Parameters:
name
- name of the CRS to create.gg
- grid geometry of the coverage.anchor
- the cell part to map (center or corner).locale
- locale to use for axis names, ornull
for default.- Returns:
- a derived CRS for coordinates (cell indices) associated to the grid extent.
- Throws:
org.opengis.util.FactoryException
- if an error occurred during the use ofCSFactory
orCRSFactory
.org.opengis.referencing.operation.NoninvertibleTransformException
-
unsupported
private static org.opengis.util.FactoryException unsupported(Locale locale, org.opengis.referencing.crs.CoordinateReferenceSystem crs) Returns the exception to throw for an unsupported CRS. -
properties
Creates a properties map to give to CS, CRS or datum constructors. -
axis
private static org.opengis.referencing.cs.CoordinateSystemAxis axis(org.opengis.referencing.cs.CSFactory csFactory, String name, String abbreviation, org.opengis.referencing.cs.AxisDirection direction) throws org.opengis.util.FactoryException Creates a coordinate system axis of the given name.- Throws:
org.opengis.util.FactoryException
-
abbreviation
Returns a default axis abbreviation for the given dimension. -
createCS
private static org.opengis.referencing.cs.CoordinateSystem createCS(int tgtDim, org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types, Locale locale) throws org.opengis.util.FactoryException Creates the coordinate system for engineering CRS.- Parameters:
tgtDim
- number of dimensions of the coordinate system to create.gridToCRS
- matrix of the transform used for converting grid cell indices to envelope coordinates. It does not matter whether it maps pixel center or corner (translation coefficients are ignored). Anull
means to handle as an identity transform.types
- the value ofGridExtent.types
or a default value (shall not benull
).locale
- locale to use for axis names, ornull
for default.- Returns:
- coordinate system for the grid extent, or
null
if it cannot be inferred. - Throws:
org.opengis.util.FactoryException
- if an error occurred during the use ofCSFactory
.
-
forExtentAlone
static org.opengis.referencing.crs.EngineeringCRS forExtentAlone(org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types) throws org.opengis.util.FactoryException Builds the engineering coordinate reference system of aGridExtent
. This is used only in the rare cases where we need to represent an extent as an envelope. This class convertsDimensionNameType
codes into axis names, abbreviations and directions. It is the converse ofGridExtent.typeFromAxes(CoordinateReferenceSystem, int)
.The CRS type is always engineering. We cannot create temporal CRS because we do not know the temporal datum origin.
- Parameters:
gridToCRS
- matrix of the transform used for converting grid cell indices to envelope coordinates. It does not matter whether it maps pixel center or corner (translation coefficients are ignored).types
- the value ofGridExtent.types
or a default value (shall not benull
).locale
- locale to use for axis names, ornull
for default.- Returns:
- CRS for the grid, or
null
. - Throws:
org.opengis.util.FactoryException
- if an error occurred during the use ofCSFactory
orCRSFactory
.- See Also:
-