You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,38 @@ This is a thin wrapper around the OpenStreetMap [Overpass API](http://wiki.opens
7
7
```
8
8
>>> import Overpass
9
9
>>> api = Overpass.API()
10
-
>>> response = api.Get('[out:json];node["name":"Salt Lake City"];out body;')
10
+
>>> response = api.Get('node["name":"Salt Lake City"]')
11
11
```
12
12
13
+
Note that you don't have to include any of the output meta statements. The wrapper will, well, wrap those.
14
+
13
15
You will get your result as a dictionary, which (for now) represents the JSON output you would get [from the Overpass API directly](http://overpass-api.de/output_formats.html#json). So you could do this for example:
14
16
15
17
```
16
18
>>> print [(feature['tags']['name'], feature['id']) for feature in response['elements']]
17
19
[(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637), (u'Salt Lake City', 1615721573)]
18
20
```
19
21
22
+
### Parameters
23
+
24
+
The API takes a few parameters:
25
+
26
+
#### `endpoint`
27
+
28
+
The default endpoint is `http://overpass-api.de/api/interpreter` but you can pass in the rambler instance (`http://overpass.osm.rambler.ru/cgi/interpreter`) or your own:
29
+
30
+
api = Overpass.API(endpoint=http://overpass.myserver/interpreter)
31
+
32
+
#### `timeout`
33
+
34
+
The default timeout is 25 seconds, but you can set it to whatever you want.
0 commit comments