[geos-devel] Exposing PrecisionModel, GeometryPrecisionReducer in the C API
strk at keybit.net
Thu Oct 1 10:15:51 PDT 2015
On Thu, Oct 01, 2015 at 07:01:33PM +0200, Sandro Mani wrote:
> On 01.10.2015 18:58, Sandro Santilli wrote:
> >On Thu, Oct 01, 2015 at 06:51:44PM +0200, Sandro Mani wrote:
> >>I like the in-place approach. So as far as my needs go, this would
> >>be perfectly adequate. (And about the generic GEOS_setPrecision,
> >>looks like too much trouble).
> >Great, I'll be pushing an implementation of that to the same PR
> >with the automatic memory management for GeometryFactory (which
> >seems an indispensable part of this) tomorrow, stay tuned for
> >tests your side !
> Cool, thanks!
Oh well, I spoke too soon.
It turns out Geometry objects are seriously immutable at the
C++ side, and don't feel like changing that.
The "normalize" method is indeed an exception also in C++,
but the only way to change a Geometry's GeometryFactory pointer is by
creating a new Geometry.
In order to reduce the copies, I'm sure we can find another signature
to apply the precision and rounding at construction time.
I'll let you make a proposal for that while I'll work on the
GEOSGeometry-returning version of the "_setPrecision" function.
() Free GIS & Flash consultant/developer
More information about the geos-devel