QGIS MultiPolygon – How to Combine Polygons from Matching Features into Single MultiPolygon

geojsongeometry-conversiongeoprocessingqgis

I have a GeoJSON file from an upstream provider that uses multiple feature "rows" to represent disjoint boundaries of what I need to treat as a single feature.

For example in the dataset that can be previewed at https://data.cityofchicago.org/Education/Chicago-Public-Schools-High-School-Attendance-Boun/8vea-73uh and downloaded at https://data.cityofchicago.org/Education/Chicago-Public-Schools-High-School-Attendance-Boun/is3f-j4ke you can see that "HIRSCH HS" (to pick one such case) has three attribute rows all with school_id of 609712 linked to three separate polygons for its boundary.

Screenshot of linked website, with multiple "Hirsch HS" popups open on its preview map

I want to gather all "matching" features — in this case whenever the school_id column has the same value — and merge the geometries of each such group into one feature. Is this possible do (in a semi-automated fashion) using the QGIS user interface?

[And yes in this example it looks like technically each row is already a "multipolygon" but regardless I want to aggregate duplicate attribute rows together into one single multipolygon so that I have only one unique feature for each underlying row ID.]

Best Answer

You want to make one polygon separated by school_id, right?

Use the dissolve tool in QGIS.
It can be found in the Vector menu -> Geoprocessing Tools -> Dissolve.

Just select the school_id as the dissolve field.

If you only want to work with features with duplicate school_id, use the select by expression to select them.
The condition is COUNT(1, "school_id")>1.