Comments (5)
Thanks for reporting the issue.
I have merged a fix into the master branch and it will be in the next release.
from python-overpy.
This is true for Python 2.7, too.
from python-overpy.
Looks like the reason for the issues are the lambda functions used as attribute_modifiers
from python-overpy.
(kindly asking 4 years later) will there ever be a "next release"? really need that fix :) thanks!
Update: For all others coming here, I've found a way using @phibos fix without a new version:
python -m pip uninstall overpy
python -m pip install --upgrade git+git://github.com/DinoTools/python-overpy.git
Collecting git+git://github.com/DinoTools/python-overpy.git
from python-overpy.
Here's our workaround for Python 2.7:
import overpy
import pickle
op = overpy.Overpass()
sample = op.query("""
way(50.746,7.154,50.748,7.157) ["highway"];
(._;>;);
out body;
""")
def make_overpy_picklable(data):
if hasattr(data, '_attribute_modifiers'):
data._attribute_modifiers = None
return data
def make_overpy_result_picklable(sample):
sample = make_overpy_picklable(sample)
for i in range(len(sample.nodes)):
sample.nodes[i] = make_overpy_picklable(sample.nodes[i])
for i in range(len(sample.ways)):
sample.ways[i] = make_overpy_picklable(sample.ways[i])
for i in range(len(sample.areas)):
sample.areas[i] = make_overpy_picklable(sample.areas[i])
for i in range(len(sample.relations)):
sample.relations[i] = make_overpy_picklable(sample.relations[i])
return sample
sample = make_overpy_result_picklable(sample)
with open('sample.pcl', 'wb') as pcl:
pickle.dump(sample, pcl)
Deleting the dictionary is not a problem as it is only needed in the constructor.
from python-overpy.
Related Issues (20)
- delete this HOT 1
- Update/Write to .osm file
- Overpy requires wheel and does not install it if it's not present on the system. HOT 3
- Osint HOT 1
- Get osm_timestamp HOT 2
- Support for Overpass API /api/status
- Support PBF HOT 1
- change BaseException to Exception? HOT 1
- Is there a possibility to query a local Overpass db? HOT 2
- Write to file HOT 4
- Polsby-Popper test
- Quering data from a localhost or patrticular osm file HOT 1
- querying data from local osm file HOT 4
- Query without parsing
- Unknown content type: text/html; charset="utf-8"
- Updating pip package HOT 3
- Road geometry extraction
- build is failing according to the readme badge
- .value() missed HOT 2
- Documentation custom url parameter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-overpy.