Why Mecklenburg-Vorpommern is part of Poland according to this overpass query? How can I fix it?

[out:xml][timeout:3600];
  area
    ['ISO3166-1'='PL'] -> .parent_area;
  (
    relation["admin_level"=4]["boundary"="administrative"](area.parent_area);
  );
  (._;>;);
  out meta;

lists Relation: ‪Mecklenburg-Vorpommern‬ (‪28322‬) | OpenStreetMap and Relation: ‪Kaliningrad‬ (‪103906‬) | OpenStreetMap (part of Russia) as being within Poland. Also apparently parts of Czech Republic and Slovakia.

This is not correct unless I missed some major geopolitical events.

What is wrong? OSM data? Overpass? My query?

1 Like

The problem is caused by the fact that that, at the moment, the Overpass API areas are quite a bit out of sync from the rest of the OSM data (normally the area data is only lagging behind the rest for a couple hours):

<meta osm_base="2025-05-08T15:12:12Z" areas="2025-02-06T02:17:44Z"/>

To explain it a bit more detail: Overpass thinks that some short pieces of the border are actually “inside” of Poland (example: overpass turbo) – these ways have been edited some time after the Overpass-internal area of Poland was last generated. In this case, this problem can be worked around by manually filtering the border lines again and excluding any lines that are also member of the relation of the original search area: overpass-turbo.eu/s/23KJ. Ideally, this would be fixed on the Overpass API servers, though.

5 Likes