You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by "Martin Desruisseaux (Jira)" <ji...@apache.org> on 2022/05/11 16:37:00 UTC
[jira] [Created] (SIS-547) Mercator projecction should wraparound longitude values
Martin Desruisseaux created SIS-547:
---------------------------------------
Summary: Mercator projecction should wraparound longitude values
Key: SIS-547
URL: https://issues.apache.org/jira/browse/SIS-547
Project: Spatial Information Systems
Issue Type: Improvement
Components: Referencing
Affects Versions: 1.1, 1.0, 0.8, 0.7, 0.6, 1.2
Reporter: Martin Desruisseaux
Assignee: Martin Desruisseaux
Fix For: 1.3
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:
{code:java}
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));
{code}
Output (reformatted for readability):
{code:none}
0 -3767132
6646680 -3767132
6814950 -3767132
-23473717 -3767132
{code}
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.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)