Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.04
-
Fix Version/s: 3.05
-
Component/s: Referencing
-
Labels:None
Description
It is possible to check if a CRS is vertical or temporal using the following checks:
- if (crs instanceof VerticalCRS)
- if (crs instanceof TemporalCRS)
but there is no similar check for horizontal CRS. A "horizontal" CRS can be a GeographicCRS, a ProjectedCRS or a DerivedCRS having an other horizontal CRS as its base (assuming that the coordinate system of the derived CRS stay in the same plane than its base CRS). The following idiom:
- if (crs == CRS.getHorizontalCRS(crs))
can be used, but it is potentially costly: if the given CRS is a 3D geographic CRS, the getHorizontalCRS method will try hard to extract a 2D geographic CRS from it, only to be discarted after the == check. A cheaper isHorizontalCRS(crs) method is desired.
