<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 29/10/2021 à 13:49, Javier Jimenez
Shaw a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CADRrdKt3wdZxBYE=ROmaS8Gdybc_wQ6Xkh6qeB5OmgGWqzRU3Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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>
</blockquote>
<p>I don't see a getter for it currently. It can be optionally
passed in the DatabaseContext::create() factory method
(DatabaseContext doesn't strictly require a PJ_CONTEXT*. From what
I can see it is only needed to find proj.db and grid files, and if
none is provided the default context is used. I hope this is safe
enough in multi threaded uses. hum...), so if there was one, you
already knew it through other means, but it wouldn't hurt if you
added a getter. Or you create one from scratch. All this is a
testimony of the ISO-19111 part having being mostly developed as
an addition besides the traditional C code base, and the
connection between the two parts being a bit tricky.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CADRrdKt3wdZxBYE=ROmaS8Gdybc_wQ6Xkh6qeB5OmgGWqzRU3Q@mail.gmail.com">
<div dir="ltr">
<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"
moz-do-not-send="true">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" moz-do-not-send="true">PROJ@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/proj</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank" moz-do-not-send="true">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>