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

Sandro Mani manisandro at gmail.com
Wed Jan 7 04:16:09 PST 2015

On 07.01.2015 13:09, Sandro Santilli wrote:
> 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.
Yes I agree.
> Once you convert GEOS geometries to QgsGeometry you don't
> really care about what PrecisionModel is recorded in them,
> do you ?
I'm not sure, what are the implications if a pass back a GEOSGeometry to 
QgsGeometry which has a fixed precision model, and not the double model 
as is default?
> --strk;
>    ()   Free GIS & Flash consultant/developer
>    /\   http://strk.keybit.net/services.html
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel

More information about the geos-devel mailing list