Skip to content
Permalink
Browse files

Applied patch of Stefanie Tellex, fixes QgsGeometry::setWkbGeometry()…

… in Python

Thanks!


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8580 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jun 3, 2008
1 parent 2d5e4d7 commit c89f755942a20ab20b900315d80279f86167c280
Showing with 7 additions and 3 deletions.
  1. +7 −3 python/core/qgsgeometry.sip
@@ -59,9 +59,13 @@ class QgsGeometry
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.

0 comments on commit c89f755

Please sign in to comment.
You can’t perform that action at this time.