aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-10-13 12:58:53 +0200
committerGitHub <noreply@github.com>2019-10-13 12:58:53 +0200
commit3804eac112da0ec5972f355644376556022e4d8f (patch)
tree13241edccee9f06713a0517aed91fd3f8843332a
parent2d25faba62c698362597a3537a3fe5c3fc7e781a (diff)
parent5620ad90e4f697d00e3b4310dc5315fd577fbb85 (diff)
downloadPROJ-3804eac112da0ec5972f355644376556022e4d8f.tar.gz
PROJ-3804eac112da0ec5972f355644376556022e4d8f.zip
Merge pull request #1653 from rouault/doc_ob_tran
ob_tran doc: fix/clarify semantics of o_lat_p/o_lon_p
-rw-r--r--docs/source/operations/projections/ob_tran.rst11
-rw-r--r--src/projections/ob_tran.cpp4
2 files changed, 10 insertions, 5 deletions
diff --git a/docs/source/operations/projections/ob_tran.rst b/docs/source/operations/projections/ob_tran.rst
index 378f1333..3a23259d 100644
--- a/docs/source/operations/projections/ob_tran.rst
+++ b/docs/source/operations/projections/ob_tran.rst
@@ -19,9 +19,10 @@ oblique projection by means of the General Oblique Transformation. The user
performs the oblique transformation by selecting the oblique projection
``+proj=ob_tran``, specifying the translation factors, :option:`+o_lat_p`, and
:option:`+o_lon_p`, and the projection to be used, :option:`+o_proj`. In the
-example of the Fairgrieve projection the latitude and longitude of the pole of
-the new coordinates, :math:`\alpha` and :math:`\beta` respectively, are to be placed
-at 45°N and 90°W and use the :ref:`moll` projection. Because the central meridian
+example of the Fairgrieve projection, the latitude and longitude of the North pole
+of the unrotated geographic CRS, :math:`\alpha` and :math:`\beta` respectively,
+expressed in the rotated geographic CRS, are to be placed
+at 45°N and 90°W and the :ref:`moll` projection is used. Because the central meridian
of the translated coordinates will follow the :math:`\beta` meridian it is
necessary to translate the translated system so that the Greenwich meridian
will pass through the center of the projection by offsetting the central meridian.
@@ -50,11 +51,11 @@ New pole
.. option:: +o_lat_p=<latitude>
- Latitude of new pole for oblique projection.
+ Latitude of the North pole of the unrotated source CRS, expressed in the rotated geographic CRS.
.. option:: +o_lon_p=<longitude>
- Longitude of new pole for oblique projection.
+ Longitude of the North pole of the unrotated source CRS, expressed in the rotated geographic CRS.
Rotate about point
................................................................................
diff --git a/src/projections/ob_tran.cpp b/src/projections/ob_tran.cpp
index 4ae8dbe7..badc6dd8 100644
--- a/src/projections/ob_tran.cpp
+++ b/src/projections/ob_tran.cpp
@@ -31,8 +31,10 @@ static PJ_XY o_forward(PJ_LP lp, PJ *P) { /* spheroid */
coslam = cos(lp.lam);
sinphi = sin(lp.phi);
cosphi = cos(lp.phi);
+ /* Formula (5-8b) of Snyder's "Map projections: a working manual" */
lp.lam = adjlon(aatan2(cosphi * sin(lp.lam), Q->sphip * cosphi * coslam +
Q->cphip * sinphi) + Q->lamp);
+ /* Formula (5-7) */
lp.phi = aasin(P->ctx,Q->sphip * sinphi - Q->cphip * cosphi * coslam);
return Q->link->fwd(lp, Q->link);
@@ -62,7 +64,9 @@ static PJ_LP o_inverse(PJ_XY xy, PJ *P) { /* spheroid */
coslam = cos(lp.lam -= Q->lamp);
sinphi = sin(lp.phi);
cosphi = cos(lp.phi);
+ /* Formula (5-9) */
lp.phi = aasin(P->ctx,Q->sphip * sinphi + Q->cphip * cosphi * coslam);
+ /* Formula (5-10b) */
lp.lam = aatan2(cosphi * sin(lp.lam), Q->sphip * cosphi * coslam -
Q->cphip * sinphi);
}