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

Unable to query solar panels for switzerland.

0

Hi everyone :) I am having trouble making specific queries for Switzerland. Below is the query that I am using that works for cities i.e. Bern and other countries i.e. United Kingdom, however for some reason whenever I change the name to Switzerland it does not work. Any advice on what I am doing wrong??
solar_query = """ [out:json]; area["name"="Switzerland"]->.searchArea; ( node(area.searchArea)["generator:source"="solar"]['generator:output:electricity'='yes']; way(area.searchArea)["generator:source"="solar"]['generator:output:electricity'='yes']; relation(area.searchArea)["generator:source"="solar"]['generator:output:electricity'='yes']; ); out body; >; out skel qt; """ Thanks so much :)

asked 15 Aug '21, 10:42

dylan_johnson123's gravatar image

dylan_johnso...
11112
accept rate: 0%


One Answer:

1

Should it be name:en rather than name, to match the English language name "Switzerland"?

answered 15 Aug '21, 18:51

alan_gr's gravatar image

alan_gr
2.6k12245
accept rate: 15%

Yes it worked :)! Thanks so much, must have missed that on the docs !

(15 Aug '21, 20:20) dylan_johnso...

Source code available on GitHub .