Tabulating Areas in Planning Units for Marxan
By: Trevor Wiens
Tags: GIS, Marxan
For users of ArcGIS using the QMarxan Toolbox for the first time, they often can not find familiar tools. Particularly troubling for them is the absence of Tabulate Intersection and a different Zonal Statistics tool.
For raster layers of categorical data the correct QGIS tool to use is Zonal Histogram. This will provide you with a count of each pixel type within the planning units. These count values can then be multiplied by the area of the pixels to give you the area of each habitat class for each planning unit. These results can then be joined to your planning unit layer using a join and making them available for export using the QMarxan tools.
For raster layers of continuous data the correct QGIS tool to use is Zonal Statistics. This can be used to get the mean value of the intersecting pixels within the planning units. These results can then be joined to your planning unit layer using a join and making them available for export using the QMarxan tools.
For vector layers, the process is a bit more involved and involves using the QGIS Group Stats plugin. First the planning unit layer needs to be intersected with the vector land classification layer. In the intersected result, then the analyst should use the QGIS field calculator to create a new column containing the area of the intersected areas. Then using the Group Stats plugin, calculate the sum of the intersected area by planning unit. This plugin might be a bit difficult to understand at first so remember that the row should be the planning unit id, the column should be the land cover class and the value will be the intersected area together with the sum function.

Once the results are calculated as shown above, then the user can export this result as a CSV file which can then be loaded back into QGIS. Note that the CSV file may have NULL values. Remember to use the QGIS field calculator to replace the NULLs with zeros. After the CSV file is loaded and NULLs replaced with zeros, the CSV file can be joined to your planning unit layer by the puid.
With both the Zonal Histogram results and the Group Stats results, when you join the outputs to your planning unit layer there may have rows with NULL values. In this case, you will need to export the results as new layer and then use the QGIS field calculator to replace the NULLs with zeros before exporting the data using QMarxan.