DinoTools / python-overpy

Python Wrapper to access the Overpass API
https://python-overpy.readthedocs.io/
MIT License
236 stars 58 forks source link

List of street name for a city ? #22

Closed armgilles closed 8 years ago

armgilles commented 8 years ago

Hey, i try to list all street's name for a city.

For Bordeaux i try this :

result = api.query("""
    area[name="Bordeaux"];way(area)[highway][name];out;
    """)
len(result.ways) #17332

This should be more more or less 2K streets.

Did i do something wrong ? :)

Virtakuono commented 8 years ago

If I am correct, your result should have multiple ways that correspond to the same street. waynames = set([way.tags['name'] for way in result.ways]) narrows it down, although not to two thousand, like you wanted. (where do you get this figure of 2K anyways?)