I have a shapefile with polygons (municipal.shp) which contains a variable (float numbers) for each municipality of an area. I want to distribute these values into a vector grid (grid.shp) with different projection. So, the splitting should be based on the area proportion of the value. In the image below you can see how the files look like and how the output should be.
1 Answer
If I understand your question correctly you can do the following:
First, both of your layers, the municipalities and the grid, need to be in the same metric projection.
Now you can calculate the value per m² of municipalities using field calculator and store it in a new field, lets say valuem2. Use "value" / $area
.
Now perform an intersection of municipalities and grid.
It will look like this (id_2 is the grids id):
When you now calculate the new value using "valuem2" * $area
you will get the new proportional value into each new splitted polygon.
Now you can reproject your final layer into whatever you want to have it.
Your final product will look like this. Value per m² is represented in a blue color ramp. Value New is represented in the size of circles at the centroids. Additionally labels with all three values. The only one of interest for you in this final result is valuenew
. You can delete the other columns to avoid confusion.
value
is the original absolute value of your municipalities.valuem2
is the relative value ofvalue
of your municipalities.valuenew
is the absolute value of your new polygons, the intersection of municipalities and grid. This will be your final product. It was calculated by thenew polygons area
multiplied withvaluem2
.
-
I tried what you suggested but I have the following problem: If a polygon (municipality) has the value of 100 and overlaps 2 grid cells of the final grid then in the final intersection.shp both grid cells have taken the value of 100. The correct would be that the value of 100 would be distributed based on the area of the polygon covered in the grid cells.– NatFeb 4, 2019 at 19:53
-
1@Nat Yes thats true, you can delete the
value
field in theintersection
layer to avoid confusion. You will recalculate the value viavaluem2 * $area
as shown in the last step: The value of interest in your final layer will bevaluenew
. Will add a screenshot to my answer. Feb 4, 2019 at 19:58 -
1@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know. Feb 4, 2019 at 20:24