[gdal-dev] Fwd: Changed API for exportToGEOS

Paul Meems bontepaarden at gmail.com
Fri Nov 8 05:52:17 PST 2013


Hi all,

Sorry to bother you all again.
We're still struggling with upgrading to GDAL and GEOS.
When I use GDALv1.9 with GEOSv3.3.5 with our C++ application (MapWinGIS), I
have no problems.
The GEOS methods are still working. I've made a test to buffer a geometry.

When I upgrade to GDAL trunk (v1.11) and GEOSv3.4.2 I can't compile my
project because of API changes.
As mentioned before the function createFromGEOS() has now a different
signature.

First of all why was this method changed instead of creating a new one?
There is a buffer and a buffer_r method.
If the new method would have been called createFromGEOS_r() we would not
have so much trouble.

Secondly I added GEOSContextHandle_t hGEOSCtxt =
OGRGeometry::createGEOSContext(); before calling the changed
createFromGEOS().
I can compile now but GEOSBuffer() is always returning NULL.

If the original situation cannot be restored be keeping createFromGEOS and
creating createFromGEOS_r I need to know how I should change the rest of my
code to make the GEOS functions work again. I can try to use buffer_r and
use the context created before. But that means I need to change a lot of
code. Before I do that I need to know if that is solving my issue.

Our BufferByDistance function is now not working and probably needs to be
changed. The source code is here:
https://mapwingis.svn.codeplex.com/svn/MapWinGIS/trunk/COM%20classes/Shapefile_Geoprocessing.cpp
Our Shape2GEOSGeom() function is now calling createGEOSContext() and
Shape2GEOSGeom is called by our BufferByDistance function. The code is here:
https://mapwingis.svn.codeplex.com/svn/MapWinGIS/trunk/Processing/GeometryConverter.cpp

I think I need to create the context in our BufferByDistance function and
pass it as an argument to our Shape2GEOSGeom() function. Next I should
switch to GEOSBuffer_r and use the same context. Am I right? Is that the
correct approach? If so I need to change the signature of our
Shape2GEOSGeom() function which is use in a lot places. That is OK, as long
as I know it is the solution.

Thanks for any help,

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131108/ee8cfb78/attachment-0001.html>


More information about the gdal-dev mailing list