|
1 | | -Overpass API python wrapper |
2 | | -=========================== |
| 1 | +Deprecated README.rst |
| 2 | +===================== |
3 | 3 |
|
4 | | -.. image:: https://github.com/mvexel/overpass-api-python-wrapper/workflows/CI/badge.svg |
5 | | - :target: https://github.com/mvexel/overpass-api-python-wrapper/actions?query=workflow%3ACI |
| 4 | +This file is deprecated. Please use ``README.md`` instead. |
6 | 5 |
|
7 | | - |
8 | | -This is a thin wrapper around the OpenStreetMap `Overpass |
9 | | -API <http://wiki.openstreetmap.org/wiki/Overpass_API>`__. |
10 | | - |
11 | | - |
12 | | -|Build Status| |
13 | | - |
14 | | -Install it |
15 | | -========== |
16 | | - |
17 | | -``pip install overpass`` |
18 | | - |
19 | | -Usage |
20 | | ------ |
21 | | - |
22 | | -Simplest example: |
23 | | - |
24 | | -.. code:: python |
25 | | -
|
26 | | - import overpass |
27 | | - api = overpass.API() |
28 | | - response = api.get('node["name"="Salt Lake City"]') |
29 | | -
|
30 | | -``response`` will be a dictionary representing the JSON output you would |
31 | | -get `from the Overpass API |
32 | | -directly <https://overpass-api.de/output_formats.html#json>`__. |
33 | | - |
34 | | -Note that the Overpass query passed to ``get()`` should not contain any |
35 | | -``out`` or other meta statements. |
36 | | - |
37 | | -Another example: |
38 | | - |
39 | | -.. code:: python |
40 | | -
|
41 | | - >>> print [( |
42 | | - ... feature['properties']['name'], |
43 | | - ... feature['id']) for feature in response["features"]] |
44 | | - [(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637)] |
45 | | -
|
46 | | -You can find more examples in the ``examples/`` directory of this |
47 | | -repository. |
48 | | - |
49 | | -Response formats |
50 | | -~~~~~~~~~~~~~~~~ |
51 | | - |
52 | | -You can set the response type of your query using ``get()``\ ’s |
53 | | -``responseformat`` parameter to GeoJSON (``geojson``, the default), |
54 | | -plain JSON (``json``), CSV (``csv``), and OSM XML (``xml``). |
55 | | - |
56 | | -.. code:: python |
57 | | -
|
58 | | - response = api.get('node["name"="Salt Lake City"]', responseformat="xml") |
59 | | -
|
60 | | -Parameters |
61 | | -~~~~~~~~~~ |
62 | | - |
63 | | -The API object takes a few parameters: |
64 | | - |
65 | | -``endpoint`` |
66 | | -^^^^^^^^^^^^ |
67 | | - |
68 | | -The default endpoint is ``https://overpass-api.de/api/interpreter`` but |
69 | | -you can pass in another instance: |
70 | | - |
71 | | -.. code:: python |
72 | | -
|
73 | | - api = overpass.API(endpoint=https://overpass.myserver/interpreter) |
74 | | -
|
75 | | -``timeout`` |
76 | | -^^^^^^^^^^^ |
77 | | - |
78 | | -The default timeout is 25 seconds, but you can set it to whatever you |
79 | | -want. |
| 6 | +The Markdown version is the canonical documentation and is kept up to date. |
80 | 7 |
|
81 | 8 | .. code:: python |
82 | 9 |
|
@@ -139,6 +66,3 @@ Where did the CLI tool go? |
139 | 66 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
140 | 67 |
|
141 | 68 | The command line tool was deprecated in version 0.4.0. |
142 | | - |
143 | | -.. |Build Status| image:: https://travis-ci.org/mvexel/overpass-api-python-wrapper.svg?branch=master |
144 | | - :target: https://travis-ci.org/mvexel/overpass-api-python-wrapper |
0 commit comments