werner2101 / python-osm Goto Github PK
View Code? Open in Web Editor NEWThis project forked from clupprich/python-osm
OpenStreetMap library for python
License: GNU General Public License v3.0
This project forked from clupprich/python-osm
OpenStreetMap library for python
License: GNU General Public License v3.0
if the node id is lower than the first node in the data file, then server throughs an error:
127.0.0.1 - - [10/Jan/2015 10:46:13] "GET /nodes?nodes=324883 HTTP/1.1" 200 - /nodes?nodes=324882 ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 49875) Traceback (most recent call last): File "/usr/lib64/python2.7/SocketServer.py", line 295, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib64/python2.7/SocketServer.py", line 321, in process_request self.finish_request(request, client_address) File "/usr/lib64/python2.7/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib64/python2.7/SocketServer.py", line 651, in __init__ self.handle() File "/usr/lib64/python2.7/BaseHTTPServer.py", line 340, in handle self.handle_one_request() File "/usr/lib64/python2.7/BaseHTTPServer.py", line 328, in handle_one_request method() File "src/python-osm/src/osm/osmdb.py", line 647, in do_GET data = osm.get_objects('node', nodes) File "src/python-osm/src/osm/osmdb.py", line 587, in get_objects blk = self._get_block(objtype, objid) File "src/python-osm/src/osm/osmdb.py", line 153, in _get_block blk = self._index[blocknr] TypeError: list indices must be integers, not NoneType
Other tests:
If the node id is larger than the largest id in the file, it does not respond (endless loop).
If the way id is lower than the lowest id in the file, server is i.O.
If the way id is larger than the largest id in the file, it does not respond (endless loop).
If the relation id is lower than the lowest id in the file, server is i.O.
If the relation id is larger than the largest id in the file, it does not respond (endless loop).
To reproduce:
python -m osm.multipolygon -r 1111111
Error:
Traceback (most recent call last):
File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/werner/osm/src/python-osm/src/osm/multipolygon.py", line 330, in <module>
mp = multipolygon(osmobj.relations[int(relation)])
File "/home/werner/osm/src/python-osm/src/osm/multipolygon.py", line 13, in __init__
self.read_relation(self.relation)
File "/home/werner/osm/src/python-osm/src/osm/multipolygon.py", line 19, in read_relation
members = self.recursive_members(relation)
File "/home/werner/osm/src/python-osm/src/osm/multipolygon.py", line 144, in recursive_members
for m in current_relation.members:
File "osm/pyosm.py", line 168, in __getattr__
return self.osm_parent.get_members(self.__members)
File "osm/pyosm.py", line 228, in get_members
obj = self.ways[mid]
KeyError: 28692993
see also http://www.openstreetmap.org/browse/relation/1111111
In order to use python-osm, some documentation, ideally containing lots of useful examples, would be useful.
One example (which I figured out myself):
To export relation with id=62578 as polygon file for osmosis:
multipolygon.py -r 62578 -m boundary.poly
with matplotlib 1.4.2 i got following error:
Traceback (most recent call last): File "./places.py", line 9, in from osm import multipolygon File "python-osm/src/osm/multipolygon.py", line 6, in import matplotlib.nxutils ImportError: No module named nxutils
Due to the numpy changes the version id in the osmhistory data is not the latest.
Thus the data can not be used to revert osm changes.
A special setter function is needed in pyosm.py.
Zum Reproduzieren:
python -m osm.multipolygon -r 27027
Bei mir kommt der Fehler
Traceback (most recent call last):
File ".../lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File ".../lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File ".../python-osm/src/osm/multipolygon.py", line 327, in <module>
mp = multipolygon(osmobj.relations[int(relation)])
File ".../python-osm/src/osm/multipolygon.py", line 12, in __init__
self.read_relation(self.relation)
File ".../python-osm/src/osm/multipolygon.py", line 18, in read_relation
members = self.recursive_members(relation)
File ".../python-osm/src/osm/multipolygon.py", line 143, in recursive_members
for m in current_relation.members:
AttributeError: 'tuple' object has no attribute 'members'
Benjamin Henne send me a request for a licence.
Current developers of the python-osm code are:
git log | grep Author | sort | uniq -c | sort -n
2 Author: Christoph Lupprich <[email protected]>
1 Author: Manuel Aristarán <[email protected]>
2 Author: Karl Palsson <[email protected]>
2 Author: Rory McCann <rory@metis.(none)>
3 Author: Denis Klimov <[email protected]>
36 Author: Werner Hoch <[email protected]>
Which license should we choose?
BSD-like, GPL2, GPL+, public domain.
hi,
i've got error
"KeyError: -1426996844"
maybe change "int" into "long" ?
Zum Reproduzieren:
python -m osm.multipolygon -r 450512
Erzeugt den Fehler:
node with more than 2 ways 665766410
Traceback (most recent call last):
File ".../lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File ".../lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File ".../lib/python2.7/site-packages/osm/multipolygon.py", line 329, in <module>
mp = multipolygon(osmobj.relations[int(relation)])
File ".../lib/python2.7/site-packages/osm/multipolygon.py", line 14, in __init__
self.read_relation(self.relation)
File ".../lib/python2.7/site-packages/osm/multipolygon.py", line 36, in read_relation
self.outer_polygons, self.outer_ways = self.create_polygons(outer_ways)
File ".../lib/python2.7/site-packages/osm/multipolygon.py", line 82, in create_polygons
ways = endnodes.pop(startnode.id)
KeyError: 665766410
Die Relation hat offensichtlich einen Knoten, in dem sich zwei Polygone (und insgesamt 4 ways) berühren. Siehe
http://www.openstreetmap.org/browse/relation/450512
http://www.openstreetmap.org/browse/node/665766410
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.