Geotoolkit

Add a CRS.isHorizontalCRS(...) convenience method

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor 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.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    13/Oct/2009 21:15
    Updated:
    14/Oct/2009 21:06
    Resolved:
    14/Oct/2009 21:06

Time Tracking

Estimated:
30m
Original Estimate - 30 minutes Original Estimate - 30 minutes
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
1h
Time Spent - 1 hour