1

I need to split several polygons (census blocks) that contains numerical attributes (population) into smaller blocks, but assigning that data proportionally.

For example: if the splitting is made by 40/60%, and the population value is 1000, i want QGIS 3.2 to assign 400/600 proportionally to each polygon.

With the Split features function, the data is duplicated (QGIS replicates ALL the original values). I would love if there was a plugin that allows it to be made using the Split Polygon function "by hand", but I know that it is practically impossible.

enter image description here

The calculated field does not work.

1st step: create a calculated field ($area)

enter image description here

2nd step: cut the “one” polygon:

enter image description here

3rd step: create a calculated field (“population” * $area / “old_area”) as Virtual Field:

enter image description here

Result: the first result is OK (on the the polygon that was cut first), the “new_pop” value was calculated fine:

enter image description here

BUT the next split does not work (polygon "two"), the “new_pop” values are: 100 and 40, when should be 60 and 40. The first row is not updated.

enter image description here

Is this a bug?

3
  • Does the virtual field update after saving the edits?
    – csk
    Oct 11, 2018 at 19:42
  • Yes, it does. Your instructions are ok. I'm new to GIS, and until now I thought that the commands of the field calculator operated as Excel functions (updated automatically). Thank you for you help! Oct 16, 2018 at 13:21
  • 1
    Sometimes there's a bit of a lag between when you edit a feature and when the virtual field updates. It's best to save edits to be sure the $area function is calculated using the updated geometry.
    – csk
    Oct 17, 2018 at 16:41

1 Answer 1

2

You can achieve this with Field Calculator.

  • Use Field Calculator to add area of original polygon as an attribute, called "old_area".
  • Split all the polygons you want to divide.
  • Add a new population attribute, called "pop_new". Use Field Calculator to calculate "pop_new" as old population multiplied by the ratio of the current area to the old area.

    "population" * $area / "old_area"

If you use a virtual field or a default field value for "pop_new" it will be automatically calculated anytime you split another polygon.

3
  • Great, easier than I thought! Thanks! The only thing that does not work is the automated calculation. When I continue splitting (after creating a virtual field as indicated), the "population" value of the original polygon is not updated, but the new polygon does. Oct 4, 2018 at 23:38
  • Are you saying that when you split one polygon into two polygons, one of the two smaller polygons is updated, but one of them is not? That seems like a bug, since the $area value is changed. Please report it at issues.qgis.org. In the mean time, you should be able to force it to update by moving one of the vertices a little bit.
    – csk
    Oct 5, 2018 at 15:05
  • I've updated the question, can you take a look, please? To confirm if I should report it as a bug or i'm doing something wrong. Oct 11, 2018 at 14:19

Your Answer

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

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