How to split and reproject a polygon shapefile into a grid based on area proportion with QGIS?
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.
How I could do that in QGIS?
qgis shapefile splitting
add a comment |
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.
How I could do that in QGIS?
qgis shapefile splitting
I don't get the point about the "area proportion", or more precisely, I don't get how proportions are connected to tilting the grid. Could you explain it in detail, please?
– Erik
yesterday
add a comment |
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.
How I could do that in QGIS?
qgis shapefile splitting
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.
How I could do that in QGIS?
qgis shapefile splitting
qgis shapefile splitting
asked yesterday
NatNat
275
275
I don't get the point about the "area proportion", or more precisely, I don't get how proportions are connected to tilting the grid. Could you explain it in detail, please?
– Erik
yesterday
add a comment |
I don't get the point about the "area proportion", or more precisely, I don't get how proportions are connected to tilting the grid. Could you explain it in detail, please?
– Erik
yesterday
I don't get the point about the "area proportion", or more precisely, I don't get how proportions are connected to tilting the grid. Could you explain it in detail, please?
– Erik
yesterday
I don't get the point about the "area proportion", or more precisely, I don't get how proportions are connected to tilting the grid. Could you explain it in detail, please?
– Erik
yesterday
add a comment |
1 Answer
1
active
oldest
votes
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.
– Nat
yesterday
1
@Nat Yes thats true, you can delete thevalue
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.
– MrXsquared
yesterday
1
@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know.
– MrXsquared
yesterday
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f311019%2fhow-to-split-and-reproject-a-polygon-shapefile-into-a-grid-based-on-area-proport%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
– Nat
yesterday
1
@Nat Yes thats true, you can delete thevalue
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.
– MrXsquared
yesterday
1
@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know.
– MrXsquared
yesterday
add a comment |
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.
– Nat
yesterday
1
@Nat Yes thats true, you can delete thevalue
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.
– MrXsquared
yesterday
1
@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know.
– MrXsquared
yesterday
add a comment |
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
.
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
.
edited yesterday
answered yesterday
MrXsquaredMrXsquared
1,2831316
1,2831316
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.
– Nat
yesterday
1
@Nat Yes thats true, you can delete thevalue
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.
– MrXsquared
yesterday
1
@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know.
– MrXsquared
yesterday
add a comment |
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.
– Nat
yesterday
1
@Nat Yes thats true, you can delete thevalue
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.
– MrXsquared
yesterday
1
@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know.
– MrXsquared
yesterday
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.
– Nat
yesterday
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.
– Nat
yesterday
1
1
@Nat Yes thats true, you can delete the
value
field in the intersection
layer to avoid confusion. You will recalculate the value via valuem2 * $area
as shown in the last step: The value of interest in your final layer will be valuenew
. Will add a screenshot to my answer.– MrXsquared
yesterday
@Nat Yes thats true, you can delete the
value
field in the intersection
layer to avoid confusion. You will recalculate the value via valuem2 * $area
as shown in the last step: The value of interest in your final layer will be valuenew
. Will add a screenshot to my answer.– MrXsquared
yesterday
1
1
@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know.
– MrXsquared
yesterday
@Nat added screenshot and short explanation. Hope it helps understanding it. If not let me know.
– MrXsquared
yesterday
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f311019%2fhow-to-split-and-reproject-a-polygon-shapefile-into-a-grid-based-on-area-proport%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I don't get the point about the "area proportion", or more precisely, I don't get how proportions are connected to tilting the grid. Could you explain it in detail, please?
– Erik
yesterday