Skip to content

Commit

Permalink
Applied patch of Stefanie Tellex, fixes QgsGeometry::setWkbGeometry()…
Browse files Browse the repository at this point in the history
… in Python

Thanks!


git-svn-id: http://svn.osgeo.org/qgis/trunk@8580 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 3, 2008
1 parent f250c3f commit 35f10e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/core/qgsgeometry.sip
Expand Up @@ -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.
Expand Down

0 comments on commit 35f10e1

Please sign in to comment.