-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for python Encode / Decode #9
Comments
I'll need to add a coding.i file wrapping the Encoder/Decoder. |
Until I get the coding.i file added, try adding this in the string Encode() const {
Encoder encoder;
$self->Encode(&encoder);
return string(encoder.base(), encoder.length());
}
bool Decode(const string& encoded) {
Decoder decoder(encoded.data(), encoded.size());
return $self->Decode(&decoder);
} That should get you started, assuming there aren't too many types you need to encode/decode. |
Thanks! I was able to encode and decode polygons successfully. I'll see if I can extend this to other types. |
I added Encoder/Decoder to the SWIG, so it should work for you without additional effort. Having the string versions would be more convenient, though. |
Hi,
I'm trying to encode and decode a polygon using as an example the C++ tests, and the Encoder() class doesn't seem to work the same, or maybe it isn't yet exposed in the SWIG files.
Is there a different way to accomplish this in python?
The text was updated successfully, but these errors were encountered: