Thursday, 21 April 2016

shapefile - Calculating polygon area inside another polygon in QGIS


Is it possible to calculate the area of colorful polygons (yellow, yellowish/reddish and red) inside another shapefile (purple outline, also polygons) in QGIS.


For example the polygon that is marked with red line: i'd like to know how much there is yellow, red etc inside the polygon with purple colored outline (area).


enter image description here




Answer



You can do it using the following steps:



  1. Select the target polygon (purple color)

  2. Use intersect tool from Vector -> Geoprocessing tools -> Intersect

  3. In the Input vector, choose the colorful polygon layer, and choose the purple layer in the intersect layer field

  4. Check Use only selected, as you can see below:


enter image description here




  1. Save the output intersected layer


  2. Start editing of the output layer and add new field in the attribute table, and give it a name Area, and in the expression, write $Area, and press on Update All to update Area field. Save edits.


    Make sure that both layers have the same projection.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...