[geos-devel] Prepared geometry API

strk strk at keybit.net
Wed Apr 8 08:08:10 EDT 2009


While working on a testcase for prepared geometries in GEOS
I've found that the documentation for the "GEOSPrepare" function
doesn't match with actual behaviour:

 /*
  * Argument ownership is taken by prepared geometry
  */
 extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare(const GEOSGeometry* g);

Testcase is along these lines:

	GEOSGeometry* g = GEOSGeomFromWKT("POLYGON EMPTY");
	const GEOSPreparedGeometry* pg = GEOSPrepare(g);
	GEOSPreparedGeom_destroy(pg);

	// 'g' leaks w/out the call below
	//GEOSGeom_destroy(g);

So, is it documentation wrong or implementation ?

--strk; 

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 


More information about the geos-devel mailing list