Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.7, 0.8, 1.0, 1.1, 1.2, 1.3, 1.4
-
None
Description
The EPSGDataAccess.createCoordinateReferenceSystem(String) queries the EPSG "Coordinate Reference System" table with more than 10 columns. Some relevant columns for this tasks are:
- COORD_REF_SYS_KIND (may be "geographic 2D", "geographic 3D", "geocentric", "projected", etc.)
- SOURCE_GEOGCRS_CODE (EPSG code of a GeographicCRS)
- PROJECTION_CONV_CODE (EPSG code of a CoordinateOperation)
Current EPSGDataAccess implementation uses the SOURCE_GEOGCRS_CODE and PROJECTION_CONV_CODE columns only if the COORD_REF_SYS_KIND is "projected". But the EPSG database sometime uses those columns for other kind of CRS. For example with WGS 84 coordinate reference systems:
- EPSG:4326 (geographic 2D) is derived from EPSG:4979 (geographic 3D) with conversion EPSG:15593 (geographic3D to geographic2D).
- EPSG::4979 (geographic 3D) is derived from EPSG::4978 (geocentric) with conversion EPSG:15592 (geocentric to geographic3D).
We could modify EPSGDataAccess as below:
- Unconditionally build a coordinate operation from SOURCE_GEOGCRS_CODE and PROJECTION_CONV_CODE columns instead than only in the projected CRS case.
- Above operation is mandatory for projected CRS case, optional for all other.
- If an operation was found, use it for creating a derived CRS like below:
CoordinateOperation op = …, CoordinateReferenceSystem base = ...; if (op instanceof Conversion && base instanceof SingleCRS) { crs = DefaultDerivedCRS.create(properties, (SingleCRS) base, (Conversion) op, cs); }
However we may want to keep Well Known Text (WKT) outputs simple by formatting the CRS as if it was a non-derived CRS. How to handle that is an open question.