Highway intersecting Waterbodies in OSM (Overpass query) - openstreetmap

I am trying to run an Overpass Query for extracting all the highway features (highway=*) that might overlap the water features (natural=water). The highway features might be a dead end in the water feature or invalid overlap on water feature. I am a newbie so still trying to figure out the correct query. This is the query I have used so far:
[out:json][timeout:2500];
(
way["highway"]->.h;
way["natural"="water"]->.w1;
node.(w.h).(w.w1)({{bbox}});
);
out meta;
out skel qt;
However it shows the error:
"
An error occurred during the execution of the overpass query! This is what overpass API returned:
Error: line 10: parse error: ';' expected - 'w' found.
"

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;

Overpass API query for specific store names

I am trying to find Costco (or similar) stores in a given area. I have tried a few queries with no luck so far. Currently I'm using Turbo, but I believe I know how to switch to http and JSON. Any advice n a working query is greatly appreciated.
Attempts include:
(a)
node
[name=Costco]
({{bbox}});
out;
This runs, but no results where I know there should be.
(b)
node
[brand:wikipedia=en:Costco]
({{bbox}});
out;
I found the brand info in results for an OpenStreetmaps search, so I think the data is in the database.
This gives error
An error occurred during the execution of the overpass query! This is what overpass API returned:
Error: line 10: parse error: '!', '~', '=', '!=', or ']' expected - ':' found.
Error: line 10: parse error: ']' expected - ':' found.
You need to enclose brand:wikipedia and en:Costco in quotes. This should work:
node ["brand:wikipedia"="en:Costco"] ({{bbox}}); out;
Try the following query:
[out:json][timeout:25];
// gather results
(
// query part for: “shop=* and name=Costco”
nwr["shop"]["name"="Costco"]({{bbox}});
// query part for: “shop=* and brand=Costco”
nwr["shop"]["brand"="Costco"]({{bbox}});
// query part for: “shop=* and operator=Costco”
nwr["shop"]["operator"="Costco"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
This searches for shops with the name, brand or operator "Costco".
You can see an example at overpass-turbo: https://overpass-turbo.eu/s/16OL

Conjunction attributes in Overpass Turbo

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.

Use PostGIS to retrieve the nearby points

I've tried to use PostGIS to retrieve the nearby points, however,
I've gotten an error message from the pgAdmin3.
Can you help me to debug the SQL queries (Postgresql+PostGIS) below?
Thank you for your kindness help.
I've used the 3826 geometry.
"ERROR: parse error - invalid geometry
HINT: "...79721.29349234176 2759680.13418412))" <-- parse error at position 44 within geometry" in the
SELECT * FROM pointslight
WHERE ST_DWithin(
ST_Transform(ST_GeomFromText('POINT(279721.29349234176 2759680.13418412))',3826),26986),
ST_Transform(location,26986), 50)
ORDER BY ST_Distance(ST_GeomFromText('POINT(279721.29349234176 2759680.13418412))',3826), location);
In the string defining the point, you have one opening parenthesis an two closing one. Remove one of the latter!

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