I am trying to filter out certain infrastructure from OSM data and convert everything to simple point layers using QGIS.
I have an OSM shapefile containing polygons of schools. In many instances, polygons lie within other polygons, for example, different faculties within a university building. However, if both polygons are categorized as university I just need one polygon with the university's name. (I don't need detailed data, just an overview). Converting every polygon to a point will result in multiple points for one single building.
So I am looking for a way to select the largest polygon and delete or merge the smaller internal polygons if they are within the same class. However, if there is a building containing a school and a kindergarten I want the polygons to remain separate.
I have tried the Select Within plugin to filter the internal polygons, but it obviously selects every single polygon, even the outer ones. The same goes for Select Layer by Location. For this, I have been working with a copy of the same layer.
Dissolving them isn't really an option either, since then I suppose I would have to preselect names first, since the name is not an attribute field and just can be found somewhere in the tags.
Just so you get an idea: I'm doing this for whole countries, so I need a way to automate this in a proper way.
Does anyone have an idea how to go about this issue?
Here is a screenshot of how the data looks. In this case, I want the MultiPolygon on the left to be merged into a single polygon with the label Technical University Munich.
"Select by expression"
together withoverlay_contains()
function?