Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.5-M0
-
Fix Version/s: 2.7.5
-
Component/s: referencing
-
Labels:None
Description
GeneralEnvelope.setRange(int, double, double) currently contains this code:
if (minimum > maximum) { // Make an empty envelope (min == max) // while keeping it legal (min <= max). minimum = maximum = 0.5 * (minimum + maximum); }
This approach has two problems:
- It is a cause of bug that may be long to identify, since the coordinates are silently modified. An exception, or at the very least a warning could save developper time.
- WCS authorizes (with special treatment) cases where maximum < minimum at least in the longitude case. They are envelope crossing the antimeridian.
We should accept maximum < minimum only for axis declared with RangeMeaning.WRAPAROUND. For other axis, we need to decide if we should throws an exception, reorder the minimum and maximum or just log a warning.
Every GeneralEnvelope methods like contains will need to be updated for taking the antimeridian crossing case in account.