<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello</p>
<p>I'm trying to find the best way to transform coordinate tupples
given an <tt>osgeo::proj::operation::CoordinateOperation</tt>
instance. My current understanding is that I need to get a <tt>PJ</tt>
object as below. Is that correct?</p>
<blockquote>
<pre>CoordinateOperationNNPtr operation = ...
PJ_CONTEXT *ctx = ...
PJ *pj = (ctx, operation);
// Then use PJ as documented in "getting started" guide.
</pre>
</blockquote>
<p>If above is the right approach, looking at the source code of <tt>pj_obj_create</tt>,
there is two things I would like to do differently:</p>
<ul>
<li>Use an existing <tt>osgeo::proj::io::DatabaseContext</tt>
instance.</li>
<li>Do not fallback on <tt>pj_new()</tt> if the main block could
not create the <tt>PJ</tt>.</li>
</ul>
<p>So would the following block be okay (I know if use an internal
method call, but I didn't saw a way to avoid it yet):</p>
<blockquote>
<pre>DatabaseContext dbContext = ...;
auto formatter = PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_5, dbContext);
auto projString = coordop->exportToPROJString(formatter.get());
PJ *pj = pj_create_internal(ctx, projString.c_str());
// Done; do not touch to pj->iso_obj or pj->cpp_context.
</pre>
</blockquote>
<p>Or is there a better way to "execute" a <tt>CoordinateOperation</tt>
with C++ API?</p>
<p> Thanks,<br>
</p>
<p> Martin</p>
<p><br>
</p>
</body>
</html>