Giter Club home page Giter Club logo

python-osm's People

Contributors

culebron avatar jazzido avatar jgrnt avatar karlp avatar marians avatar werner2101 avatar zver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python-osm's Issues

osm/osmdb.py crashed in .bz2 mode on low node ids

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).

multipolygons with multilinestring boundary segments don't work

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

Documentation is needed

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

osmhistory: version id is not the latest

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.

Fehler in multipolygon relation=27027

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'

python-osm has no licence

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.

Fehler in multipolygon relation=450512

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.