2

I've tried to play with Overpass from command line because I've to do a query quite "expensive" that Overpass Turbo can't to do

My issue is about to download all the addresses in Italy

Here you are my query (it comes from Overpass Turbo ...)

<osm-script output="json">
 <union into="_">
  <query into="_" type="node">
   <has-kv k="addr:housenumber" modv="" v=""/>
   <bbox-query e="20.01708984375" into="_" n="47.15984001304432" s="36.27970720524017" w="5.9765625"/>
  </query>
 </union>
 <print e="" from="_" geometry="skeleton" limit="" mode="body" n="" order="id" s="" w=""/>
 <recurse from="_" into="_" type="down"/>
 <print e="" from="_" geometry="skeleton" limit="" mode="skeleton" n="" order="quadtile" s="" w=""/>
</osm-script>

I've saved it in a file "CiviciItalia.txt", and then I've used the following command

wget --post-file=CiviciItalia.txt http://overpass-api.de/api/interpreter --output-document=CiviciItalia.json

All works fine and I've obtained a .json file but ...... how may I visualize it on some GIS desktop tools (es. QGIS)?

1

You can change the first line to

<osm-script>

to get an ordinary osm file which can be used by the QuickOSM plugin for input.

If it is too big, try to use GDAL ogr2ogr to transform it to a spatialite database.

Apart from that, you are only querying housenumbers on nodes. You will miss housenumbers put on building footprints. These are stored in closed ways or multipolygon relations. You might need relations of type associatedStreetas well in cases were the addr:street is not set on the object were the addr:housenumber is put onto.

You might get kicked out of Overpass turbo if the service is overloaded. A safer way would be to query a Geofabrik extract with osmfilter locally.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.