[geos-devel] Exposing PrecisionModel, GeometryPrecisionReducer in the C API

Sandro Santilli strk at keybit.net
Wed Jan 7 04:09:32 PST 2015

On Wed, Jan 07, 2015 at 12:28:17PM +0100, Sandro Mani wrote:

> I think the main reason for exposing it is to be able to work with
> geometries with different PrecisionModels in the same session. This
> is actually my case: I have a QGIS plugin which take the GEOS
> Geometries from QgsGeometry, which are created with the default (aka
> double) precision, and then I perform operations on those geometries
> with reduced precision.
> This actually makes me realize that I really
> should be handing back a GEOSGeometry to QgsGeometry with the
> original PrecisionModel, so ideally there would also be a
> extern GEOSGeometryPrecisionReducer*
> GEOSGeometryPrecisionReducer_create(double precision);
> which does not change the GEOSGeometryFactory of the reduced
> geometry.

Do you really just need a "coordinate rounder" kind of function or do
you want GEOS itself to perform operations using a reduced precision
model ?

> Or otherwise a function which allows to change the
> PrecisionModel of a Geometry a posteriori.

Changing the PrecisionModel of a Geometry is really needed
to change the behavior of GEOS operations themselves. This
is the kind of "exposure" I'd be interested to. 

Once you convert GEOS geometries to QgsGeometry you don't
really care about what PrecisionModel is recorded in them,
do you ?


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the geos-devel mailing list