I wanted to get all federal states in Germany via Overpass. With this query I get almost the desired result:
[out:json];
relation(51477);
map_to_area -> .germany;
relation(area.germany)["type"="boundary"]["boundary"="administrative"]["admin_level"="4"];
out tags;
https://overpass-turbo.eu/s/1alL
Unfortunately one of the results is not a German federal state: Groningen
Groningen is actually an area in the Netherlands, but because of the border parts are within German territory.
To fix this result, I thought check if each relation is completly in the territory of Germany. But I'm quite new to Overpass and the syntax is a bit complicated to understand.
Any idea if this is possible? Or is it even a bug that OVerpass returns Groningen even though only a part of it is inside of Germany (according to OpenStreetMap data)?