Hi all! 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
All works fine and I've obtained a .json file but ...... how may I visualize it on some GIS desktop tools (es. QGIS)? Any suggestion is appreciated Cesare asked 13 Jan '15, 09:10 cesaregerbino |
I have done something similar to that for my hackerspace map (ignore the old link for 'how it's made'). I used osmtogeojson, a command line programme that converts the JSON from Overpass into a GeoJSON file, that you can then display with Leaflet, like I do with that map. QGis should be able to open GeoJSON files as well. osmtogeojson is the programme that overpass turbo uses to convert to geojson to display on the map. answered 13 Jan '15, 09:48 rorym I've seen ... Unfortunately I'm on Windows 7 now ..... I'll try to do using a Linux VM ....
(13 Jan '15, 09:59)
cesaregerbino
It's a javascript programme, and installable with node package manager (npm). Maybe it might work on windows? Javascript /is/ cross platform (ish)...
(13 Jan '15, 10:03)
rorym
I'll try ....
(13 Jan '15, 10:05)
cesaregerbino
geojson.io can also open and display the geojson files from the osmtogeojson script (I presume). To make it all happen from the command line, you should be able to pipe the output of osmtogeojson into
(11 Nov '18, 03:22)
b-jazz
|
Another option is to use the CSV output format, with the QGis can support Deliminted Text (like CSV), so you should be able to open the file in it. answered 14 Jan '15, 11:46 rorym |
Try QuickOSM (a QGIS plugin). It can run Overpass queries, does all the conversion 'under the hood' and presents the result as new layer in QGIS. You can also save that result as shape file, etc. And it should also run on Windows. BTW: I wonder why you didn't specify a timeout value in your query. Quite likely you're getting incomplete results after hitting the timeout. answered 13 Jan '15, 11:52 mmd 1
I've also tried to use QuickOSM using QGIS 2.6.1 but can't obtain the result, something goes wrong. About timeout .... By default Overpass Turbo put timeout:25 but my query is much longer ..... So I've decided to drop timeout ... I'm a newbie about overpass: have I to specify in any case a timeout to avoid incomplete result?
(13 Jan '15, 12:24)
cesaregerbino
Regarding the timeout: Overpass API immediately starts sending some data rather than buffering the whole result. If you happen to see a respective error message at the end of your json file, your timeout was too low. (see timeout for more details). In any case, I would recommend to set at least a timeout of 300 seconds. The query took about 2-3 minutes when I executed it.
(13 Jan '15, 20:45)
mmd
Your query result gives QGIS a really hard time. Crunching numbers for 20 minutes now, still not finished, GeoJSON temporary file is now at about 3.5GB, still counting... Maybe you need to think about some other approach, like feeding the result into a PostGIS database instead.
(13 Jan '15, 21:53)
mmd
|