This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Extract all hydropower stations or dams along one river

0

I am looking for a way to get all hydropower stations or dams that are along a given river via Overpass turbo. Something like the following but for a given river instead of a given country:

[out:json][timeout:25];
{{geocodeArea:Sweden}}->.searchArea;
(
node["power"="plant"]["plant:source"=hydro](area.searchArea);
way["power"="plant"]["plant:source"=hydro](area.searchArea);
relation["power"="plant"]["plant:source"=hydro](area.searchArea);
);
out center;

For example, for all hydropower stations or dams along Luleälven (https://www.openstreetmap.org/relation/6974663). Perhaps it is possible to generate a search area that covers the river, e.g. extending the center of the river bed by 200 m on each side of the river. Or by using a search area that is defined to be "near" the river (most hydropower stations are on the river, but sometimes, they can be besides it, e.g. when the original river bed is bypassing the power station). Perhaps one could even use a search line instead of a search area.

Thanks for all hints!

asked 02 Jun '21, 21:00

G%C3%A5seborg's gravatar image

Gåseborg
31171016
accept rate: 50%

edited 02 Jun '21, 22:08


One Answer:

1

'around' is the command you're looking for.

{{geocodeArea:Sweden}};
rel[name="Luleälven"]->.river;
.river out geom;
nwr(around.river:50)[power=plant]["plant:source"=hydro](area);
out center;

I've set the value to 50m, you may need to increase that, but it'll take longer to run & may return erroneous results.

FYI use 'nwr'; it saves a lot of typing

answered 03 Jun '21, 00:01

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 03 Jun '21, 00:03

This works perfectly! Thanks also for the hint on 'nwr' which I was not aware of :)

(03 Jun '21, 09:23) Gåseborg

@DaveF: One more detail, the river in the example gets water from many smaller rivers. I tried including the largest one of those ("Lilla Luleälven") by changing the second line in your answer to (rel[name="Luleälven"];rel[name="Lilla Luleälven"];)->.river; As a result, the outline of both rivers is shown correct in Overpass turbo, but it cannot find any stations any longer. Could you even give me a hint on how to get this done correcly? That would be great! Perhaps there even is a way to specify just the main river but adding an additional argument to include all mapped tributaries. Thanks in advance!

(14 Jun '21, 21:06) Gåseborg

Source code available on GitHub .