TransWikia.com

Using QuickOSM to select more values in key?

Geographic Information Systems Asked by CSyrett on March 21, 2021

In using QGIS, I would like to select several values at once within the same key in QuickOSM.

I’m not at all familiar with coding!

Can someone suggest a simple point-by-point method to do this?

An example would be:

  • In Quick Queries, I select “amenities” under Key. Under Value, I’d like to select colleges, schools, hospitals.

Is there a way to do this, so that I don’t have to do one at a time?

2 Answers

The QuickOSM plugin dialogue also has an option to use a query from the Overpass Turbo API.

http://overpass-turbo.eu/

Here I can construct a query to find amenities = bench and townhall using the wizard:

amenity = bench or amenity = townhall

The query runs and the results show, but the code to run this shows on the side:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“amenity = bench or amenity = townhall”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “amenity=bench”
  node["amenity"="bench"]({{bbox}});
  way["amenity"="bench"]({{bbox}});
  relation["amenity"="bench"]({{bbox}});
  // query part for: “amenity=townhall”
  node["amenity"="townhall"]({{bbox}});
  way["amenity"="townhall"]({{bbox}});
  relation["amenity"="townhall"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Simply copy and paste that query code into the Query pane in QuickOSM, then click Run Query:

enter image description here

If you don't get all the geometry types returning, open up the 'advanced' section to ensure all geometry types are set. At first all geometry types weren't returned. When I opened the 'advanced' tab - without changing anything - and ran the query again, all geometry types came back.

Answered by DPSSpatial_BoycottingGISSE on March 21, 2021

For future look outs: you are looking in the wrong place with your query. You want to query for buildings.

<osm-script output="xml" timeout="25">
    <id-query {{geocodeArea:Oldenburg, Germany}} into="area_0"/>
    <union>
        <query type="node">
            <has-kv k="building" v="hotel"/>
            <area-query from="area_0"/>
        </query>
        <query type="way">
            <has-kv k="building" v="hotel"/>
            <area-query from="area_0"/>
        </query>
        <query type="relation">
            <has-kv k="building" v="hotel"/>
            <area-query from="area_0"/>
        </query>
    </union>
    <union>
        <item/>
        <recurse type="down"/>
    </union>
    <print mode="body"/>
</osm-script>

Answered by Daniel on March 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP