improved wkb integration and python3 compatibility