[QGIS Commit] r8580 - trunk/qgis/python/core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Jun 3 10:15:34 EDT 2008
Author: wonder
Date: 2008-06-03 10:15:34 -0400 (Tue, 03 Jun 2008)
New Revision: 8580
Modified:
trunk/qgis/python/core/qgsgeometry.sip
Log:
Applied patch of Stefanie Tellex, fixes QgsGeometry::setWkbGeometry() in Python
Thanks!
Modified: trunk/qgis/python/core/qgsgeometry.sip
===================================================================
--- trunk/qgis/python/core/qgsgeometry.sip 2008-06-03 13:45:12 UTC (rev 8579)
+++ trunk/qgis/python/core/qgsgeometry.sip 2008-06-03 14:15:34 UTC (rev 8580)
@@ -59,9 +59,13 @@
Set the geometry, feeding in the buffer containing OGC Well-Known Binary and the buffer's length.
This class will take ownership of the buffer.
*/
- // SIP: buffer will be transferred from python to C++
- // TODO: create pythonic interface that will receive wkb as a string
- void setWkbAndOwnership(unsigned char * wkb /Transfer, Array/, size_t length /ArraySize/);
+ void setWkbAndOwnership(unsigned char * wkb /Array/, size_t length /ArraySize/);
+%MethodCode
+ // create copy of Python's string and pass it to setWkbAndOwnership()
+ unsigned char * copy = new unsigned char[a1];
+ memcpy(copy, a0, a1);
+ sipCpp->setWkbAndOwnership(copy, a1);
+%End
/**
Returns the buffer containing this geometry in WKB format.
More information about the QGIS-commit
mailing list