[geos-devel] Exposing Precision model through C-API

Sandro Santilli strk at keybit.net
Wed Feb 19 22:30:45 PST 2014

Hi Sean,

On Wed, Feb 19, 2014 at 11:15:18AM -0700, Sean Gillies wrote:

> My Shapely project would benefit from this feature and I've written up its
> requirements here: https://github.com/Toblerity/Shapely/issues/110.
> Briefly, I'd like to be able to pass a precision model reference into
> initGEOS and create an appropriate geometry factory in the GEOS context.
> And I'd like to be able to switch between precision models within a Python
> program, so not adding any new state outside of the context struct would be
> my preference.

I agree about making the precision model part of the context.
But we can't change the initGEOS signature, so we'll need
some GEOSContext_setPrecisionModel kind of method.
At that point, we have to decide what happens with a previously
set PrecisionModel, if it has to be allowed at all.

Deleting the PrecisionModel and the GeometryFactory on finishGEOS
is fine, but note that this would make any created geometry also
broken (they hold a reference to the GeometryFactory that created
them). Not a big deal, as long as it's clearely documented. Dunno
if it would make sense for the opaque GEOSGeometry type to also
hold a pointer to the context, just in case...

> Once a wiki page is created, I'll be happy to copy my requirements there.

I hope Varun will take action about the wiki :)


More information about the geos-devel mailing list