[Proj] C++ coding practices w.r.t object ownership

Even Rouault even.rouault at spatialys.com
Sun May 27 16:23:45 EST 2018

> I'm a bit concerned by all the hidden cost of object duplication with the
> approach I tried. And if you instanciate various projected coordinate
> systems based on the same datum, currently all the datum information would
> be duplicated in each PCS object, whereas with a pointer based approach you
> would have just one instance of it.

I've experienced with the shared_ptr approach in

The most satisfactory result is the removal of the clone() hacks. Side effect is that the creation of
the GeographicCRS is 30% faster than the previous approach (measured on a 1 million iterations loop)


Spatialys - Geospatial professional services

More information about the Proj mailing list