Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.6, 0.7, 0.8, 1.0, 1.1, 1.2
-
None
Description
When the central meridian has a value different than zero, user may expect a range of 180° on the east of central meridian to produce positive easting values and conversely on for 180° on the west of central meridian. This is currently not the case:
ProjectedCRS crs = (ProjectedCRS) CRS.forCode("EPSG:3994"); MathTransform prj = crs.getConversionFromBase().getMathTransform(); double[] coordinates = {-41, 100, -41, 179, -41, 181, -41, -179}; prj.transform(coordinates, 0, coordinates, 0, 4); System.out.println(java.util.Arrays.toString(coordinates));
Output (reformatted for readability):
0 -3767132 6646680 -3767132 6814950 -3767132 -23473717 -3767132
Other map projection implementations rely on trigonometric functions for applying an implicit wraparound. For example in a call to sin(λ) the λ argument value is implicitly reduced to a range of -π … +π around the λ₀ (central meridian). But it does not happen in the particular case of the Mercator projection, since the Easting value is just a multiplication factor without trigonometric functions involved. So we have to do the wraparound ourselves.
Attachments
Attachments
Issue Links
- is related to
-
SIS-486 Some map projections produce wrong results when |Δλ| > 180°
- Closed