Hi all members of the list,

I try to handle exception with the CAPI. I use the GEOSGeomFromWKT function and I want to avoid segmentation fault when a wrong wkt string is given as a parameter. Reading the comments in geos_c.h, I expected this function return a NULL pointer when an exception was raised, but strangely, it seems that he seg fault happens in the function call. So I get no return values and I can't handle exceptions.

Here is a simple example of what I want to do:
/****************************/
 GEOSGeometry *g;
 g = GEOSGeomFromWKT("POLYGON(0.0 0.0, 1.0 1.0, 2.0 2.0, 0.0 0.0))");
 if (g==NULL)
   fprintf(stderr,"g is not a valid geometry\n");
/****************************/

Do I miss something ?

Thanks in advance,
Olivier.

_______________________________________________
geos-devel mailing list
geos-devel@geos.refractions.net
http://geos.refractions.net/mailman/listinfo/geos-devel

Reply via email to