<div dir="ltr"><div>Thanks Even.</div><div><br></div><div>I see that proj_create takes a PJ_CONTEXT *ctx as the first argument. What I have in C++ is a DatabaseContextPtr. Can I get a PJ_CONTEXT* from a DatabaseContextPtr?</div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">.___ ._ ..._ .. . ._. .___ .. __ . _. . __.. ... .... ._ .__<br>Entre dos pensamientos racionales <br>hay infinitos pensamientos irracionales.<br><br></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 29 Oct 2021 at 12:17, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</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>
<p><br>
</p>
<div>Le 29/10/2021 à 12:00, Javier Jimenez
Shaw a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>Using C++ I am trying this: Given two CRSs, I would like to
have access to the list of possible transformations (like with
projinfo), and use those transformations to transform
coordinates (like with cs2cs).</div>
<div><br>
</div>
<div>Studying the code of projinfo, that uses mainly the C++
API, I already have a
std::vector<CoordinateOperationNNPtr>. Nice, I can dump
them in different formats.</div>
<div><br>
</div>
<div>However, when I go to the code of cs2cs, I see that it is
mainly using the C API.</div>
<div><br>
</div>
<div>Is there any C++ equivalent to the function</div>
<div>PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction,
PJ_COORD coord);</div>
<div>?</div>
</div>
</blockquote>
<p>No.</p>
<p>If you know which transformation you want to do, what you can
easily do is exportToPROJString() it, and use proj_create() to
instanciate it as a PJ* object you can use with proj_trans()</p>
<p>That's more or less what proj_create_operations() +
proj_list_get() do.<br>
</p>
<p>Even<br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks.<br>
</div>
<div>
<div>
<div dir="ltr">.___ ._ ..._ .. . ._.
.___ .. __ . _. . __.. ... .... ._ .__<br>
Entre dos pensamientos racionales <br>
hay infinitos pensamientos irracionales.<br>
<br>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
PROJ mailing list
<a href="mailto:PROJ@lists.osgeo.org" target="_blank">PROJ@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote></div>