With this query, I get the outline of the department of Yonne in France and the points representing the wind turbines.
[out:json];
area["ref:INSEE"="89"]->.a;
rel(area.a)["boundary"="administrative"]["admin_level"="6"];
out geom;
node(area.a)["power"="generator"]["generator:source"="wind"];
out geom;
I would also like to obtain the outline of the municipalities where the wind turbines are located.
Can you help me modify the query?
Here's how you would do it in overpass turbo: https://overpass-turbo.eu/s/1vWa . Explanations are inline...
[out:json] // json output format
[bbox:{{bbox}}]; // restrict to current bounding box in overpass turbo
// find wind turbines
node["power"="generator"]["generator:source"="wind"];
// and print them
out;
// determine areas in which wind turbines are located
is_in;
// determine corresponding boundary=adminsitrative ways and relations with admin level 6 or 8.
wr(pivot)["boundary"="administrative"]["admin_level"~"[68]"];
// and print boundaries
out geom;