We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I wanted to persist the built Rtree in my code, but what was stored was an empty pickle file. The code is as follows:
import rtree import pandas as pd import pickle spatial_index = rtree.index.Index() df = pd.read_csv("block_loc", sep='\t') for i, row in df.iterrows(): id = int(row[0]) longitude = float(row[1]) latitude = float(row[2]) print(id, longitude, latitude) spatial_index.insert(id, (longitude, latitude)) print(spatial_index) with open("spatial_index.pickle", "wb") as f: pickle.dump(spatial_index, f)
Rtree object:rtree.index.Index(bounds=[-150, 38, 150, 40], size=689274)
Objects read from pickle file:rtree.index.Index(bounds=[1.7976931348623157e+308, 1.7976931348623157e+308, -1.7976931348623157e+308, -1.7976931348623157e+308], size=0)
Why is this
The text was updated successfully, but these errors were encountered:
See #87, pickling is currently broken, fixes would be very appreciated.
Sorry, something went wrong.
Excuse me, do you want me to try fixing this bug?
If you can that would be great. I tried in #197 but couldn't come up with a satisfying solution.
No branches or pull requests
I wanted to persist the built Rtree in my code, but what was stored was an empty pickle file. The code is as follows:
Rtree object:rtree.index.Index(bounds=[-150, 38, 150, 40], size=689274)
Objects read from pickle file:rtree.index.Index(bounds=[1.7976931348623157e+308, 1.7976931348623157e+308, -1.7976931348623157e+308, -1.7976931348623157e+308], size=0)
Why is this
The text was updated successfully, but these errors were encountered: