2

I have a polygon shapefile comprised of 4 polygons representing landslides (see image). None of them are overlapped. Number 1 comprises everyone (2, 3 and 4). Number 4 comprises number 3. Finally number 2 and 3 are indivual.

I've calculated the area of every individual polygon but I need to calculate the involved areas as mentioned above. Is there any possibility of adding up the areas creating a new field using the field calculator?

enter image description here enter image description here

3

Add a new field to the layer, called A_combined

In the attribute table, select the target feature, enter an expression into the field update bar, and click "update selected."

enter image description here

Substitute the name of your layer into the following expressions:

For feature 1 (feature1 + feature2 + feature3 + feature4), use this expression

attribute( $currentfeature,  'A (km2)' ) 
+ attribute( get_feature( 'layer name', 'id',2), 'A (km2)' ) 
+ attribute( get_feature( 'layer name', 'id',3), 'A (km2)' ) 
+ attribute( get_feature( 'layer name', 'id',4), 'A (km2)' ) 

For feature 4 (feature3 + feature4), use this expression

attribute( $currentfeature, 'A (km2)' ) 
 + attribute( get_feature( 'layer name', 'id',3), 'A (km2)' ) 

For features 2 and 3, use this expression

attribute( $currentfeature, 'A (km2)' ) 
  • Thanks so much for your fast answer. It worked! Awesome! – GisAmateur Apr 3 '18 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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