Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.6, 0.7, 0.8, 1.0, 1.1, 1.2, 1.3, 1.4
-
None
-
None
Description
Coordinate systems are usually not allowed to have two axes with the same orientation. For example it is considered an error to have two axes oriented toward East. But there is at least two exceptions to this rule:
- AxisDirection.OTHER: there is actually no way to know which direction it is, so two OTHER orientations may be actually different directions.
- AxisDirection.FUTURE: meteorological data can have two time axes. For more information, see OGC Best Practice for using Web Map Services (WMS) with Time-Dependent or Elevation-Dependent Data (OGC 12-111r1).
Currently, attempt to transform two CRS having duplicated axis orientation produces an exception like below:
org.opengis.util.FactoryException: Ne peut pas créer l’objet géodétique pour « CompoundCRS[“grib-lonlat-crs+Java…”] → CompoundCRS[“grib-lonlat-crs+Java…”] ». at org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperation(CoordinateOperationFinder.java:206) at org.apache.sis.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:750) at org.apache.sis.referencing.CRS.findOperation(CRS.java:610) ... 22 more Caused by: java.lang.IllegalArgumentException: Les directions d’axes Other et Other sont colinéaires. at org.apache.sis.referencing.operation.matrix.Matrices.createTransform(Matrices.java:267) at org.apache.sis.referencing.operation.matrix.Matrices.createTransform(Matrices.java:440) at org.apache.sis.referencing.cs.CoordinateSystems.swapAndScaleAxes(CoordinateSystems.java:280) at org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperation(CoordinateOperationFinder.java:204) ... 26 more
One possible approach may be to remember the indirect association between axes and CRS during the computation performed by Matrices.createTransform(…). If two axes have the same axis direction but we can still distinguish the axes by the enclosing CRS instance, then we can avoid throwing the exception.