Skip to content

Commit 4ff916a

Browse files
committed
update examples and fix example in README
1 parent 0fdabf4 commit 4ff916a

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.DS_Store
44

55
# Byte-compiled / optimized / DLL files
6-
__pycache__/
6+
**/__pycache__/
77
*.py[cod]
88

99
# C extensions

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ Note that the Overpass query passed to `get()` should not contain any `out` or o
3030
Another example:
3131

3232
```python
33-
print [(feature['tags']['name'], feature['id']) for feature in response['elements']]
34-
[(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637), (u'Salt Lake City', 1615721573)]
33+
>>> print [(
34+
... feature['properties']['name'],
35+
... feature['id']) for feature in response["features"]]
36+
[(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637)]
3537
```
3638

3739
You can find more examples in the `examples/` directory of this repository.

examples/readme_example.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
3+
import overpass
4+
5+
api = overpass.API()
6+
response = api.get('node["name"="Salt Lake City"]')
7+
print(response)
8+
print [(
9+
feature['properties']['name'],
10+
feature['id']) for feature in response["features"]]

examples/turn_restriction_relations_as_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22

33
# Retrieves a list of turn restriction relations in Toronto.
44

examples/unique_users_for_area.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)