|
20 | 20 |
|
21 | 21 |
|
22 | 22 | class API(object):
|
23 |
| - """A simple Python wrapper for the OpenStreetMap Overpass API.""" |
| 23 | + """A simple Python wrapper for the OpenStreetMap Overpass API. |
| 24 | +
|
| 25 | + :param timeout: If a single number, the TCP connection timeout for the request. If a tuple |
| 26 | + of two numbers, the connection timeout and the read timeout respectively. |
| 27 | + Timeouts can be integers or floats. |
| 28 | + :param endpoint: URL of overpass interpreter |
| 29 | + :param headers: HTTP headers to include when making requests to the overpass endpoint |
| 30 | + :param debug: Boolean to turn on debugging output |
| 31 | + :param proxies: Dictionary of proxies to pass to the request library. See |
| 32 | + requests documentation for details. |
| 33 | + """ |
24 | 34 |
|
25 | 35 | SUPPORTED_FORMATS = ["geojson", "json", "xml", "csv"]
|
26 | 36 |
|
@@ -60,7 +70,17 @@ def __init__(self, *args, **kwargs):
|
60 | 70 | requests_log.propagate = True
|
61 | 71 |
|
62 | 72 | def get(self, query, responseformat="geojson", verbosity="body", build=True):
|
63 |
| - """Pass in an Overpass query in Overpass QL.""" |
| 73 | + """Pass in an Overpass query in Overpass QL. |
| 74 | +
|
| 75 | + :param query: the Overpass QL query to send to the endpoint |
| 76 | + :param responseformat: one of the supported output formats ["geojson", "json", "xml", "csv"] |
| 77 | + :param verbosity: one of the supported levels out data verbosity ["ids", |
| 78 | + "skel", "body", "tags", "meta"] and optionally modifiers ["geom", "bb", |
| 79 | + "center"] followed by an optional sorting indicator ["asc", "qt"]. Example: |
| 80 | + "body geom qt" |
| 81 | + :param build: boolean to indicate whether to build the overpass query from a template (True) |
| 82 | + or allow the programmer to specify full query manually (False) |
| 83 | + """ |
64 | 84 | # Construct full Overpass query
|
65 | 85 | if build:
|
66 | 86 | full_query = self._construct_ql_query(
|
|
0 commit comments