2

I have two shapefiles that identify flood zones for the same general area but in different years. The maps, however, do not cover exactly the same geographical areas (e.g., shapefile 1 covers counties A, B, C, and D while shapefile 2 covers counties B, C, D, and E) and the maps change from one year to the next as some areas are reclassified.

I need to do two things:

  1. Restrict the exercise to the areas that are covered by both shapefiles (e.g., counties B, C, and D). The shapefiles do not, however, have a county identifier. They only have polygons and the flood zone designation (e.g., A*, X, VE).
  2. For the area in which they do overlap, I need to compute the percentage of areas designated as, say, "A" in shapefile 1 that are still "A" in shapefile 2, and the percentages that were reclassified to other designations (e.g., X, VE). And I need to do this for all possible classifications that exist in shapefile 1.

The expected outcome has two parts. First, the percentage of the overlap area that has the same designation in both shapefiles. Second, the percentage of the overlap area in each category in shapefile 1 that is reclassified into different categories in shapefile 2 (as in a transition matrix).

I'm using QGIS for this (3.10 or 3.16) on Linux.

Two examples follow:

  1. This shows shapefile 1 with the polygons identified by black lines and shapefile 2 with the polygons in red. It shows areas that are only covered by shapefile 1 (white area and black polygons), only by shapefile 2 (white area, red polygons), and the overlap area.

enter image description here

  1. Adding labels (black for shapefile 1 and red for shapefile 2) for a zoomed in area to show reclassification.

enter image description here

1 Answer 1

0

I ended up using the Intersection feature in Processing -> Toolbox -> Vector overlay to identify the area of overlap of the two shapefiles.

Then, using the resulting shapefile, I went to the Attributes table -> Open Field Calculator and created a new field using $area. With this I got the area of each polygon which I ended up exporting as a csv together with the zone classification associated with the two original shapefiles. This allowed me to create a pivot table that had the output of interest (the transition matrix of the areas according to their flood zone designations in shapefile 1 and shapefile 2).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.