[Qgis-developer] new dependency on GEOS C++ library

Sandro Santilli strk at keybit.net
Thu Oct 1 07:38:53 PDT 2015


On Thu, Oct 01, 2015 at 04:31:31PM +0200, Sandro Santilli wrote:
> On Thu, Oct 01, 2015 at 02:17:15PM +0200, Sandro Santilli wrote:
> 
> > As known from the beginning, the challenge here is dealing with
> > management of the many GeometryFactory objects that would result
> > from the possibility of expressing them freely, and I start thinking
> > there's no way out of this than adding refcounting to the
> > GeometryFactory object so that it self-manages.
> 
> I've stubbed this mechanism here:
> https://github.com/libgeos/libgeos/pull/52
> 
> Basically, once you don't need an explicit handle on your
> GeometryFactory you can call its "autoDestroy()" method and
> it will be destroyed once all the geometries referencing it
> are also deleted.
> 
> Could be a key to what we're trying to do here.

Note that with such feature, there would only need to be a single
new interface in the C-API, namely requesting reduction of the
precision of a geometry and optional scaling of coordinates.
There would be no need at all to expose PrecisionModel or
GeometryFactory to the outside world. Internally, the C-API might
still try to optimize the memory by re-using existing factories
with the same PrecisionModel.

I guess this discussion would be better conducted on geos-dev
though...

--strk;


More information about the Qgis-developer mailing list