How to properly query for forest areas using Overpass API?


I am trying to select all forest areas using Overpass API.
However, when I test my query code on, for example:

(area["name"="Luzern"]; )->.searchArea;

I am just getting very small parts of the actual forest areas, as can be seen in the image below.

Can someone tell me what I am doing incorrectly?

Many forests are mapped as multipolygon relations, rather than ways, as forests often have non-forest areas inside them. For example Gütschwald, , is a multipolygon - there is an outer way around the forest but it is not tagged - the tagging is on the relation. So for each way[…] in your query you will need to include a corresponding relation […].

(There may be other issues but that is the most obvious one).

Aside from including multipolygons in your search, there is another issue.
To include ways tagged landuse=forest and natural=wood in your search result, you need to create a union of both separate sets you get. This can be archieved by enclosing both lines starting with way in brackets:


This will result in over 2000 ways for Luzern, testing queries on a smaller area might be advisable.