Skip to content
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

Cannot pickle TransformerLocal object #1058

Closed
jolivetr opened this issue Apr 14, 2022 · 0 comments · Fixed by #1060
Closed

Cannot pickle TransformerLocal object #1058

jolivetr opened this issue Apr 14, 2022 · 0 comments · Fixed by #1060
Labels

Comments

@jolivetr
Copy link

Dear all,

I have the impression that some objects cannot be pickled in pyproj. I saw that issue #897 raised the problem which got solved in #901, but I still cannot pickle a TransformerLocal object.

Here is an example of what does not work on my machine.

import pickle

import pyproj as pp
from pyproj import Transformer

utm = pp.CRS(proj='utm', zone=10, ellps='WGS84')

trans = Transformer.from_crs(pp.CRS('WGS84'), utm, always_xy=True)

with open('temp.pickle', 'wb') as f:
    pickle.dump(trans, f)

with open('temp.pickle', 'rb') as f:
    trans_unpickled = pickle.load(f)

print(trans == trans_unpickled)

Problem description

Running this little script returns a TypeError: cannot pickle 'TransformerLocal' object

Environment Information

  • pyproj version 3.3.0
  • PROJ version 8.2.0
  • PROJ data directory /opt/local/lib/proj8/share/proj
  • Python version 3.8.13 (default, Mar 17 2022, 17:04:31) [Clang 13.0.0 (clang-1300.0.29.30)]
  • Operation System Information macOS-12.2.1-x86_64-i386-64bit

Installation method

MacPorts

@jolivetr jolivetr added the bug label Apr 14, 2022
@snowman2 snowman2 added this to To do in 3.3.1 Release via automation Apr 15, 2022
@snowman2 snowman2 moved this from To do to Done in 3.3.1 Release Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant