I'm a newbie, apologies if this is obvious/has already been asked and answered but I couldn't find anything.
I have two shapefiles: 1. an administrative boundary layer for a county in the UK known as an LSOA boundary that has 500 little zones in it 2. a flood zone.
Ideally I want to find out which of the little LSOA zones are ≥50% within the flood zone and end up with a yes/no or a 1/0 for each of the 500 LSOA zones.
But I don't know how to do this. I figured I could Join the two shapefiles, but there's no common attribute between them. Then I thought I could use the Join Attribute by Location function, which worked and shows me which LSOA are in the flood zone, but that's nearly all of them (see image 2).
I think this is an SQL problem but I don't know. I'm new to QGIS and have never used PostgreSQL.
Any help would be greatly appreciated. I can provide whatever info you lovely people need to help me out.
Best Answer
This is a relatively simple task using the geoprocessing tools included in QGIS.
Vector > Geometry Tools > Singleparts to Multipart
. [EDIT: in recent versions this tool is renamed toCollect Geometries
]Vector > Geoprocessing Tools > Intersect
.The resulting layer will be the parts of the LSOA zones (with the attributes from the LSOA zones layer) which overlapped with the flood zones layer. To calculate the proportion of each LSOA zone within a flood zone:
Join the original LSOA layer to the intersected layer, using the unique ID shared by both layers.
Export the joined layer as a new shapefile.
Delete the duplicated attributes.
Et voilà!
Without step #2, an individual feature would be created for each different flood zone feature for each LSOA feature. This probably isn't what you want if you're only interested in the total coverage for each LSOA zone. If you want to differentiate between fluvial / tidal / pluvial flooding (and the flood zone data supports it), you could convert singlepart s to multipart specifying the "TYPE" field as the Unique ID field.