You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sis.apache.org by "Martin Desruisseaux (Jira)" <ji...@apache.org> on 2022/02/18 08:19:00 UTC
[jira] [Assigned] (SIS-537) Oblique Stereographic: Wrong longitude in reverse transform + suggested fix
[ https://issues.apache.org/jira/browse/SIS-537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Desruisseaux reassigned SIS-537:
---------------------------------------
Fix Version/s: 1.2
Assignee: Martin Desruisseaux
> Oblique Stereographic: Wrong longitude in reverse transform + suggested fix
> ----------------------------------------------------------------------------
>
> Key: SIS-537
> URL: https://issues.apache.org/jira/browse/SIS-537
> Project: Spatial Information Systems
> Issue Type: Bug
> Components: Referencing
> Affects Versions: 1.1
> Reporter: Emmanuel Giasson
> Assignee: Martin Desruisseaux
> Priority: Major
> Fix For: 1.2
>
>
> The Oblique Stereographic transform projects just fine in forward, but the reverse transform offset almost half the longitudes by nearly 180 degrees.
> h2. Bug location and suggested fix
> Problem seems to be in
> {{org/apache/sis/referencing/operation/projection/ObliqueStereographic.java}}
> method {{inverseTransform(...)}}
> {{ ...}}
> {{ final double i = atan(x / (h + y));}}
> {{ final double j = atan(x / (g - y)) - i;}}
> {{ ...}}
> {{ final double λ = j + 2*i;}}
> EPSG Guidance notes (for instance, p.71 of [https://www.iogp.org/wp-content/uploads/2019/09/373-07-02.pdf)] uses atan2 instead of atan, which effectively fixes the +/- 180 degrees issue in this case. Actually, it's not exactly 180 degrees since it is possible for {{i}} to be correct with either atan or atan2, and only for {{j}} to be 180 degrees off.
> h2. To reproduce
> With the following transformation, project POINT(30 45) then reverse project. Result is POINT(-149.84855267371876 45.000000000000014) but should be near the original point instead.
> Param_MT["Oblique Stereographic",
> Parameter["semi_major", 6378137.0, Unit["metre", 1]],
> Parameter["semi_minor", 6356752.314245179, Unit["metre", 1]],
> Parameter["Latitude of natural origin", 45.0, Unit["degree", 0.017453292519943295]],
> Parameter["Longitude of natural origin", -70.0, Unit["degree", 0.017453292519943295]]]
--
This message was sent by Atlassian Jira
(v8.20.1#820001)