mvexel / overpass-api-python-wrapper

Python bindings for the OpenStreetMap Overpass API
Apache License 2.0
360 stars 89 forks source link

Add overpassify as a recommended libarary #87

Closed LivInTheLookingGlass closed 2 years ago

LivInTheLookingGlass commented 6 years ago

If you did, then you could have an example like:

import overpass
from overpassify import overpassify

api = overpass.API()

@api.Get
@overpassify
def response():
    search = Area(3600134503)
    ways = Way(search, highway=...)
    nodes = Node(search)
    out(ways, geom=True, count=True)
    out(nodes, geom=True, count=True)
    noop()

print(response)

Everything is written in Python, yet you still get to make an OverpassQL query.

fsj-digital commented 6 years ago

can you give more examples plz? That would be great

LivInTheLookingGlass commented 6 years ago

The following should return roads without speed limits in areas 3600134503 and 3600134502

import overpass
from overpassify import overpassify

api = overpass.API()

@api.Get
@overpassify
def response():
    Settings(timeout=1400)
    search = Area(3600134503) + Area(3600134502)
    ways = Way(search,
               maxspeed=None,
               highway=NotRegex("cycleway|footway|path|service"),
               access=NotRegex("private")
    )
    out(ways, body=True, geom=True, qt=True)
    noop()

print(response)
mvexel commented 6 years ago

What would be the best way to add Overpassify as a recommended library, @gappleto97 ?

LivInTheLookingGlass commented 6 years ago

By adding it to the code examples you already have, as a way to write these queries with less translation effort.

mvexel commented 6 years ago

The posted example does not work for me, I don't know overpassify so relying on you to fix @gappleto97 :)

See https://github.com/mvexel/overpass-api-python-wrapper/blob/master/examples/overpassify_example.py

mvexel commented 2 years ago

Closing this as overpassify does not seem actively maintained. Re-open if I am wrong @gappleto97 !