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/qgis@8580 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 3, 2008
1 parent 2d5e4d7 commit c89f755
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/core/qgsgeometry.sip
Original file line number Diff line number Diff line change
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 c89f755

Please sign in to comment.