File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,13 @@ class QgsGeometry
59
59
Set the geometry, feeding in the buffer containing OGC Well-Known Binary and the buffer's length.
60
60
This class will take ownership of the buffer.
61
61
*/
62
- // SIP: buffer will be transferred from python to C++
63
- // TODO: create pythonic interface that will receive wkb as a string
64
- void setWkbAndOwnership(unsigned char * wkb /Transfer, Array/, size_t length /ArraySize/);
62
+ void setWkbAndOwnership(unsigned char * wkb /Array/, size_t length /ArraySize/);
63
+ %MethodCode
64
+ // create copy of Python's string and pass it to setWkbAndOwnership()
65
+ unsigned char * copy = new unsigned char[a1];
66
+ memcpy(copy, a0, a1);
67
+ sipCpp->setWkbAndOwnership(copy, a1);
68
+ %End
65
69
66
70
/**
67
71
Returns the buffer containing this geometry in WKB format.
You can’t perform that action at this time.
0 commit comments