[ 
https://issues.apache.org/jira/browse/SIS-547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Desruisseaux reopened SIS-547:
-------------------------------------

> Mercator projection 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: 0.6, 0.7, 0.8, 1.0, 1.1, 1.2
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>            Priority: Major
>             Fix For: 1.3
>
>         Attachments: image-2022-07-29-17-16-59-619.png, 
> image-2022-07-29-17-21-47-669.png
>
>
> 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.10#820010)

Reply via email to