[PROJ] Way to transform coordinates given an osgeo::proj::operation::CoordinateOperation?

Even Rouault even.rouault at spatialys.com
Wed Oct 9 07:56:32 PDT 2019


On mercredi 9 octobre 2019 16:36:10 CEST Martin Desruisseaux wrote:
> Le 09/10/2019 à 16:19, Even Rouault a écrit :
> > You have indeed to go to the C API, but use proj_create() instead of
> > pj_create_internal()
> 
> Thanks. But looking at proj_create() source code, it seems to fetch its
> own DatabaseContext (or maybe not, depending on PROJ string content).

It should normally use the one of the PJ_CONTEXT.

> Can I assume that the PROJ string will be such as proj_create() will not
> need to fetch a DatabaseContext?

Yes, a PROJ pipeline string shouldn't open the database.

> 
> If understand that a PJ object can be used by only one thread at a time.
> But does PJ retains a reference to PJ_CONTEXT or DatabaseContext after
> construction?

Yes

> In the later case, the requirement would be a little bit
> stronger since I must ensure that no PJ constructed with the same
> PJ_CONTEXT are used in same time, right?

Yes

Or use
void PROJ_DLL proj_assign_context(PJ* pj, PJ_CONTEXT* ctx);

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list