<div>Thanks for your reply, Mateusz.<br></div><div><br></div><div>I know (and use) Overpass turbo. However, what I want to do is to store a query and execute it in order to update results and store them as a file for further manipulation, so I can easily update results without the need to accessing to the interface, generate the query, run it and then download the results. I would like to achieve same functionallity but just by executing a file (which, additionally, may have more than one query).<br></div><div><br></div><div>So far, I found <a rel="nofollow" title="https://github.com/DinoTools/python-overpy" target="_blank" href="https://github.com/DinoTools/python-overpy">overpy</a>, which seems to work fine in terms of querying but has two problems for me: <br></div><ol><li>It seems to be unmaintained (last commit dates from April 2017)<br></li><li>I didn't succeed in storing the result into a geospatial file (or a geopandas data frame) (visit this jupyter lab with my current achievements: <a href="https://github.com/ccamara/osm-python/blob/master/overpy-demo.ipynb">https://github.com/ccamara/osm-python/blob/master/overpy-demo.ipynb</a>)<br></li></ol><div>I also have just found <a rel="nofollow" title="https://github.com/mvexel/overpass-api-python-wrapper" target="_blank" href="https://github.com/mvexel/overpass-api-python-wrapper">Overpass API wrapper</a>, but I still have to explore it and understand how does it work and how can I tame it to my needs.<br></div><div><br></div><div>You propose a third way, which is using overpass and writing a script. It is not clear to me what do you mean with that, since I thought that that was precisely what I was attempting. Could you be more specific, please? Do you have other insight?<br></div><div><br></div><div>Regards,<br></div><div>Carlos<br></div><div><br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div>Carlos Cámara-Menoyo<br></div><div><a href="https://carloscamara.es" title="https://carloscamara.es">https://carloscamara.es</a><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Monday 11 March de 2019 a les 14:15, Mateusz Konieczny <matkoniecz@tutanota.com> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><div style="16px"><br></div><div style="16px"><br></div><div style="16px"><br></div><div style="16px">Mar 11, 2019, 11:18 AM by talk@openstreetmap.org:<br></div><blockquote style="border-left: 1px solid #93A3B8; padding-left: 10px; margin-left: 5px;"><div>Dear colleagues,<br></div><div><br></div><div data-value="0">I have just started to use Python and I would like to  make a query to
 Overpass and store the results in a geospatial format (e.g. GeoJSON) so I can programatically update the data.<br></div><div><p>As far as I know, there is a library called <code>overpy</code> that should be what I am looking for. After reading <a target="_blank" rel="noopener noreferrer" href="https://python-overpy.readthedocs.io/en/latest/example.html">its documentation</a> I came up with the following code:<br></p><pre style><code><span>
</span><span>import</span><span> overpy

API </span><span>=</span><span> overpy</span><span>.</span><span>Overpass</span><span>()</span><span>

</span><span># Fetch highways within Granollers' city.</span><span>

result </span><span>=</span><span> API</span><span>.</span><span>query</span><span>(</span><span>"""
    area[name="Granollers"][admin_level=8];
    // query part for: “highway=*”
    (way["highway"](area);
    relation["highway"](area);
    );
    // print results
    out body;
    """</span><span>)</span><span>
</span></code><br></pre><p>The thing is that I am not familiar at all with Python and I don't know how to store <code>result</code> as a GeoJSON file (Honestly, I don't even know what kind of thing <code>result</code> is -I tried with <code>type(result)</code> and I get <code>overpy.Result</code> as an output, which doesn't mean much to my poor knowledge). I have been reading <code>overpy</code> documentation but I haven't been able to figure it out.<br></p></div><div><div>Can anyone give me a clue with this?<br></div></div></blockquote><div style="16px">Are you familiar with <a href="http://overpass-turbo.eu/">http://overpass-turbo.eu/</a> <a href="https://wiki.openstreetmap.org/wiki/Overpass_turbo">https://wiki.openstreetmap.org/wiki/Overpass_turbo</a> ?<br></div><div style="16px"><br></div><div style="16px">There are two parts here<br></div><div style="16px"><br></div><div style="16px">(1) using overpass itself<br></div><div style="16px">(2) writing python script<br></div><div style="16px"><br></div><div style="16px">That are separate (you can call Overpass API from any program, not just python)<br></div><div style="16px"><br></div><div style="16px">"I have just started to use Python" - note that it means learning two separate languages at once:<br></div><div style="16px"><br></div><div style="16px">(1) Python itself<br></div><div style="16px">(2) Overpass query syntax<br></div><div style="16px"><br></div><div style="16px">PS In case that Overpass is new for you my page may be of some use:<br></div><div style="16px"><br></div><div style="16px">https://mapsaregreat.com/geographic-data-mining-and-visualisation-for-beginners/overpass-turbo-tutorial.html<br></div></blockquote><div><br></div>