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
Note that the Overpass query passed to `get()` should not contain any `out` or other meta statements.
29
+
30
+
Another example:
31
31
32
32
```python
33
33
print [(feature['tags']['name'], feature['id']) for feature in response['elements']]
34
34
[(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637), (u'Salt Lake City', 1615721573)]
35
35
```
36
36
37
-
You can specify the format of the response. By default, you will get GeoJSON using the `responseformat` parameter. Alternatives are plain JSON (`json`) and OSM XML (`xml`), as ouput directly by the Overpass API.
37
+
You can find more examples in the `examples/` directory of this repository.
38
+
39
+
### Response formats
40
+
41
+
You can set the response type of your query using `get()`'s `responseformat` parameter to GeoJSON (`geojson`, the default), plain JSON (`json`), CSV (`csv`), and OSM XML (`xml`).
38
42
39
43
```python
40
44
response = api.get('node["name"="Salt Lake City"]', responseformat="xml")
41
45
```
42
46
43
47
### Parameters
44
48
45
-
46
49
The API object takes a few parameters:
47
50
48
-
#### endpoint
51
+
#### `endpoint`
49
52
50
53
The default endpoint is `https://overpass-api.de/api/interpreter` but
51
54
you can pass in another instance:
@@ -54,7 +57,7 @@ you can pass in another instance:
54
57
api = overpass.API(endpoint=https://overpass.myserver/interpreter)
55
58
```
56
59
57
-
#### timeout
60
+
#### `timeout`
58
61
59
62
The default timeout is 25 seconds, but you can set it to whatever you
60
63
want.
@@ -63,13 +66,13 @@ want.
63
66
api = overpass.API(timeout=600)
64
67
```
65
68
66
-
#### debug
69
+
#### `debug`
67
70
68
71
Setting this to `True` will get you debug output.
69
72
70
73
### Simple queries
71
74
72
-
In addition to just send your query and parse the result, the wrapper
75
+
In addition to just sending your query and parse the result, the wrapper
73
76
provides shortcuts for often used map queries. To use them, just pass
0 commit comments