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
5959 Set the geometry, feeding in the buffer containing OGC Well-Known Binary and the buffer's length.
6060 This class will take ownership of the buffer.
6161 */
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
6569
6670 /**
6771 Returns the buffer containing this geometry in WKB format.
You can’t perform that action at this time.
0 commit comments