Conjunction attributes in Overpass Turbo - openstreetmap

I would like to build a query in overpass Turbo in order to find all cathedrals with specific characteristics such as
amenity=place_of_worship,religion=catholic,denomination=St. Mary etc.
How could i combine all these attributes into this simple query provided by overpass turbo
node
[amenity=drinking_water]
({{bbox}});
out;
Additionally i have found this osm map feature guide for use.

Just use the overpass turbo wizard, enter "amenity=place_of_worship and religion=catholic" and it will generate the following query:
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“amenity=place_of_worship and religion=catholic”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “amenity=place_of_worship and religion=catholic”
node["amenity"="place_of_worship"]["religion"="catholic"]({{bbox}});
way["amenity"="place_of_worship"]["religion"="catholic"]({{bbox}});
relation["amenity"="place_of_worship"]["religion"="catholic"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
Also see the Overpass API Language Guide.

Related

How can I obtain all of the street names under a polygon in Overpass?

I am new to overpass (after only discovering it last night). I have a polygon I drew on QGIS and I plan to obtain its coordinates (long, lat). I'd then like to use these coordinates in overpass to obtain all of the road names in that area. I found a query online that obtains all road names in a city:
[out:csv ("name")][timeout:2500];
{{geocodeArea:Roma}}->.searchArea;
(
way["highway"]["name"](area.searchArea);
);
for (t["name"])
{
make street name=_.val;
out;
}
How can I adjust the following query so that I can specify a polygon function instead of city/area name?. I'm mindful of the syntax:
(poly:"latitude_1 longitude_1 latitude_2 longitude_2 latitude_3 longitude_3 …");
I'm just not sure where it would go in the query. I tried a few times but I was receiving errors or just blank results. Hopefully if I see an example I should be able to carry out my task effectively.
After doing some research I found the answer. This would give me a list of road names:
[out:csv ("name")][timeout:2500];
way["highway"]["name"]
(poly:"51.5566 0.0763 51.5734 0.0724 51.5203 0.0293");
out tags;
And this would give me a map view:
way["highway"]["name"]
(poly:"51.5566 0.0763 51.5734 0.0724 51.5203 0.0293");
out geom;

Building a simple Overpass Turbo search query for amenity

I've read though the documentation but still a little confused - I would like to build a simple query for example all fuel stations within an area and just output to a csv the name, brand and lat / long only.
Eg I would like something like this:
XYZ Service Station, Shell, -33.8042874, 18.872144
SO far I am using this but not really getting the output I would like.
[out:csv(::id,name,::lat,::lon; false; ",")]
[bbox:{{bbox}}];
nwr[amenity=fuel];
out center;

How can I search for elements within a polygon with Overpass?

I am new to Overpass API and GIS in general.
Is there an easy way to export all buildings in a specific region using coordinates to specify the polygon? I couldn't find a solution using the wiki and google so far.
I have large sets of coordinates which are determining some medium-voltage grids.
Or is there another tool I could use?
I want to use the polygon- coordinates of the exported buildings in matlab.
Thanks for your help!
Overpass API provides the (poly: ) filter to query objects inside a given polygon. See the documentation in the wiki for details.
Buildings in a given polygon can be queried as follows:
way[building](poly:"50.7 7.1 50.7 7.12 50.71 7.11");
(._;>;);
out meta;
Due to a recent memory limitation, you might have to either add a [maxsize: xxx] setting:
[maxsize:2073741824];
way[building](poly:"50.7 7.1 50.7 7.12 50.71 7.11");
(._;>;);
out;
or resort to the following workaround to force another evaluation sequence:
way(poly: "50.7 7.1 50.7 7.12 50.71 7.11");
way._[building];
(._;>;);
out meta;

Extracting nodes from highways

I am using overpass turbo to extract nodes from highways(=motorway). Below is the code that I am using. However, this code gives me all the nodes in the bounding box and does not filter the highways.
[out:xml];
(
(way(39.90,32.83,39.96,32.89);)->.a;
((way.a["highway"="motorway"]);)->.b;
((way.a["highway"="motorway_link"]);)->.b;
);
(.b;>;);
out body qt;
see my answer posted on help.osm.org: https://help.openstreetmap.org/questions/41754/extracting-node-from-highways
Try this query instead:
[out:xml]
[timeout:25]
;
(
way
["highway"="motorway"]
(39.90,32.83,39.96,32.89);
way
["highway"="motorway_link"]
(39.90,32.83,39.96,32.89);
);
out body;
>;
out skel qt;
You can view it on overpass turbo. Note that it doesn't return any results because the given bounding box doesn't contain motorways. Either increase the bounding box size or choose a different highway value, for example highway=primary.

Prevent Overpass API from returning nodes and show ways only

I'm trying to get all roads around a certain point. I'm using the following query:
(
way
(around:300,50.7913547,-1.0944082)
["highway"~"^(primary|secondary|tertiary|residential)$"]
["crossing"!~"."]
["name"];
>;
);
out;
I added the crossing exclusion because it kept including "markers" for crossings, and I'm only interested in roads.
However it seems to be ignoring the crossing and still plotting markers on the map, rather than just showing road outlines. This can be seen here.
These "nodes" that I don't want have the tags:
crossing=zebra
highway=crossing
which should fail my regex query, but it doesn't.
How do I get it to just return road plot lines, and none of these nodes/markers?
Sorry if my terminology is all wrong, I'm very new to this
The filter criterion you tried to use would only apply to the way itself rather than the nodes. Usually, a way wouldn't have a crossing tag, so this filter didn't have much of an effect on the final result. By using >; all of the nodes tags would shown up in the final result again.
I removed >; in your query and replaced out; by out geom; to only output the node lat/lon position without any tags.
You can try this out using the following link (currently pointing to overpass turbo beta)
Link