<div dir="ltr"><div>One way to look at it is that the lat_p lon_p moves the new pole along a meridian to a new location; the rotation pole</div><div>then is always on the equator (at right angles to the meridian plane). So there as, as expected, only two parameters:</div><div>the longitude of the rotation pole, and the amount of rotation around it. To get a general rotation, you have to</div><div>introduce a second rotation, which is always around the geographic pole; it can be before or after that pole is</div><div>moved, The direction of the rotation pole is not a free parameter, but the amount of rotation around it is, so</div><div>we have the appropriate number of parameters (3, as in a unit quaternion) for a general rotation.</div><div><br></div><div>So if you decompose the full rotation into two quaternions, one for the rotation around the geographic pole, and</div><div>one to move that pole to a new location (rotation pole on the equator), then the parameters of these are what you</div><div>need for proj. (Though again the order is, move the pole, then rotate around it).<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 9, 2022 at 11:12 PM DAVEN P QUINN <<a href="mailto:daven.quinn@wisc.edu">daven.quinn@wisc.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div>
<div name="messageBodySection">
<div dir="auto">Thanks to everyone in this conversation for their suggestions.<br>
<br>
It seems to me that there are two approaches that have been suggested that may work: using the `lat_p` and `lon_p` options to `ob_tran`, and using a pipeline that converts to geocentric cartesian coordinates, does a Helmert transform (consisting entirely of
 rotation), and converts back to angular space.<br>
<br>
I have also tried the “move the pole location” signature of ob_tran (by computing the new location of the pole based on my desired spatial rotation), and it does seem to do a reasonable spatial shift, but there is a rotational component that is not properly
 accounted for in that method. I have tried to handle that last degree of freedom by a combination of `lon0` and `alpha`, but I think the alpha in this case does a rotation in Cartesian space.<br>
<br>
The Helmert option seems potentially viable (though slightly less preferred because pipelines are only possible in the most recent PostGIS version) but I was under the impression that was used mostly for small angular shifts of data already in projected (i.e.,
 2 or 2.5d) space, not rotating a full geocentric manifold through a large angle. I will try it out though.<br>
<br>
Another option seems like it might be two stages of ob_tran pole movement, first moving the north pole of the projection to the pole of rotation, changing the longitude around that pole, and then moving the pole back to its computed final location. It seems
 like getting the math right in this case would be challenging.<br>
<br>
I will continue exploring in these directions, and read the code Evan provided for more context. Any additional thoughts on this synthesis would be appreciated.<br>
<br>
Regards,</div>
</div>
<div name="messageSignatureSection"><br>
<div>
<div dir="auto">Daven</div>
</div>
</div>
<div name="messageReplySection">On Nov 9, 2022, 5:42 PM +0100, Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>>, wrote:<br>
<blockquote type="cite" style="border-left:thin solid grey;margin:5px;padding-left:10px">
<br>
<blockquote type="cite"><br>
How does Proj actually do the G.O.T? I don't mean what are the<br>
parameters, I mean what is the actual code that does the arithmetic?<br>
</blockquote>
<br>
==> <a href="https://urldefense.com/v3/__https://github.com/OSGeo/PROJ/blob/master/src/projections/ob_tran.cpp__;!!Mih3wA!HHXFjskzBWFI9_IxlFUM-46NRb1QWDuaNyPUxfLXyVk8IKiTAoHvTltVWLjjml34reMXW8_pGh3jBdCkxGvi0A$" target="_blank">https://github.com/OSGeo/PROJ/blob/master/src/projections/ob_tran.cpp</a><br>
<br>
<br>
--<br>
<a href="https://urldefense.com/v3/__http://www.spatialys.com__;!!Mih3wA!HHXFjskzBWFI9_IxlFUM-46NRb1QWDuaNyPUxfLXyVk8IKiTAoHvTltVWLjjml34reMXW8_pGh3jBdBc-pV4kA$" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
</blockquote>
</div>
</div>

</blockquote></div>