Clustering points and summing up attributes per cluster in QGISHow to divide my area into adjacent polygons containing 80 points each?MYSQL 5.6 Cluster / chain points by distance to any other point without millions of calculations?Get a single cluster from cloud of points with specified maximum diameter in postgisIdentify points in a shapefile that have no other point within x km with QGISAlgorithm for clustering points into pairs (exactly two) by proximity without re-useHow can I cluster all points in a postgis table together based on their distance from each other?Clustering point data to obtain maximum count groups using QGIS?Reading attribute popup information from cluster presented points in the map generated via qgis2web?Cluster Points on spatial network in R/QGISGrouped “labels” for QGIS 3.0 Point Cluster styling?
A Journey Through Space and Time
Are there any consumables that function as addictive (psychedelic) drugs?
Why is the design of haulage companies so “special”?
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?
"which" command doesn't work / path of Safari?
How can I fix this gap between bookcases I made?
If Manufacturer spice model and Datasheet give different values which should I use?
How is this relation reflexive?
Patience, young "Padovan"
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
Circuitry of TV splitters
I probably found a bug with the sudo apt install function
least quadratic residue under GRH: an EXPLICIT bound
Could a US political party gain complete control over the government by removing checks & balances?
Shell script can be run only with sh command
What are these boxed doors outside store fronts in New York?
XeLaTeX and pdfLaTeX ignore hyphenation
Draw simple lines in Inkscape
Why CLRS example on residual networks does not follows its formula?
LED on same Pin as Toggle Switch, not illuminating
How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?
TGV timetables / schedules?
Prevent a directory in /tmp from being deleted
Clustering points and summing up attributes per cluster in QGIS
How to divide my area into adjacent polygons containing 80 points each?MYSQL 5.6 Cluster / chain points by distance to any other point without millions of calculations?Get a single cluster from cloud of points with specified maximum diameter in postgisIdentify points in a shapefile that have no other point within x km with QGISAlgorithm for clustering points into pairs (exactly two) by proximity without re-useHow can I cluster all points in a postgis table together based on their distance from each other?Clustering point data to obtain maximum count groups using QGIS?Reading attribute popup information from cluster presented points in the map generated via qgis2web?Cluster Points on spatial network in R/QGISGrouped “labels” for QGIS 3.0 Point Cluster styling?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
We want to find out the ideal location for sheds and the required dimensions of each shed. As input, we have a point layer with locations (each representing one arable field) and the estimated yield per point (per arable field).
What we now try to do is first to create four clusters for these fields. This should serve as an approximation of the ideal location for a new shed. We've done this by simply using the "point cluster"
option in the "symbology"
section and adjusting the distance until only four cluster points remained. These cluster points were then saved as new point shapefile.
How do we determine what points are actually clustered in each of the cluster points?
With this information, we can then sum up the estimated yields for all the single points per cluster. This would allow us to calculate whether the shed has to be designed for 10 tons or 100 tons of grain.
qgis clustering connectivity-analysis
add a comment |
We want to find out the ideal location for sheds and the required dimensions of each shed. As input, we have a point layer with locations (each representing one arable field) and the estimated yield per point (per arable field).
What we now try to do is first to create four clusters for these fields. This should serve as an approximation of the ideal location for a new shed. We've done this by simply using the "point cluster"
option in the "symbology"
section and adjusting the distance until only four cluster points remained. These cluster points were then saved as new point shapefile.
How do we determine what points are actually clustered in each of the cluster points?
With this information, we can then sum up the estimated yields for all the single points per cluster. This would allow us to calculate whether the shed has to be designed for 10 tons or 100 tons of grain.
qgis clustering connectivity-analysis
add a comment |
We want to find out the ideal location for sheds and the required dimensions of each shed. As input, we have a point layer with locations (each representing one arable field) and the estimated yield per point (per arable field).
What we now try to do is first to create four clusters for these fields. This should serve as an approximation of the ideal location for a new shed. We've done this by simply using the "point cluster"
option in the "symbology"
section and adjusting the distance until only four cluster points remained. These cluster points were then saved as new point shapefile.
How do we determine what points are actually clustered in each of the cluster points?
With this information, we can then sum up the estimated yields for all the single points per cluster. This would allow us to calculate whether the shed has to be designed for 10 tons or 100 tons of grain.
qgis clustering connectivity-analysis
We want to find out the ideal location for sheds and the required dimensions of each shed. As input, we have a point layer with locations (each representing one arable field) and the estimated yield per point (per arable field).
What we now try to do is first to create four clusters for these fields. This should serve as an approximation of the ideal location for a new shed. We've done this by simply using the "point cluster"
option in the "symbology"
section and adjusting the distance until only four cluster points remained. These cluster points were then saved as new point shapefile.
How do we determine what points are actually clustered in each of the cluster points?
With this information, we can then sum up the estimated yields for all the single points per cluster. This would allow us to calculate whether the shed has to be designed for 10 tons or 100 tons of grain.
qgis clustering connectivity-analysis
qgis clustering connectivity-analysis
edited Mar 30 at 0:39
PolyGeo♦
53.8k1781245
53.8k1781245
asked Mar 29 at 7:20
cbrcbr
454
454
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I would try K-means clustering algorithm in the QGIS Processing Toolbox (under Vector analysis
group).
Just by setting the Number of clusters
as 4, it will produce a new Clusters
layer with an attribute field CLUSTER_ID (values= 0, 1, 2, 3
).
Then an expression like SUM("yield", "CLUSTER_ID")
in the Field Calculator will return the total yield for each cluster. (E.G. the Sum_per_Cluster
in the below example).
[Update]
To obtain center point per the group (cluster), please try Mean coordinate(s) geoalgorithm in Processing Toolbox > Vector analysis
.
Mean coordinates dialog window will show an option Unique ID field. Select CLUSTER_ID
field.
Thank you very much for the quick and helpful reply! How did you create the center points of the clusters? When I use the method I described in my initial post (using"Symbology"
and"Cluster"
), I get center points completely off the actual cluster center (see [ibb.co/VmkhS0x]). This may stem from the different calculation methods. What approach did you use in your example? Furthermore, I get a lot of "NULL" results when I do the K-means clustering (see [ibb.co/VNdQ7bS]). Do you have a solution for this issue? Thank you very much!
– cbr
Mar 29 at 14:16
Since I only get error pages when trying to access the uploaded images but cannot edit the comment anymore (>5 min), here other links: Cluster center -> imgur.com/a/fs3R1K1 ; NULL -> imgur.com/a/Cv7IuCr
– cbr
Mar 29 at 14:23
@cbr To create center point for each cluster, please useCentroids
geoalgorithm. I will update my post. As to the center points (red circles) in my example, they werePoint cluster
symbology just for comparison.
– Kazuhito
Mar 29 at 21:47
@cbr Your upperleft (north western) cluster in the provided image has only two locations in that cluster, which does not seem right. (You would not build shed just for those two). I am not sure what happened with locations with NULL outputs; they may be outliers. Perhaps I would check their locations visually, and manually assign most appropriate cluster id.
– Kazuhito
Mar 29 at 22:03
Thanks very much for your reply! Thecentroids
algorithm only returns the same location for each of the selected points (so the output is a layer with the same amount of points as the input layer). I assume that the center point for each point was calculated but not one single point for the whole cluster... Is there another intermediate step necessary I made have missed?
– cbr
Mar 30 at 7:33
|
show 5 more comments
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%2f317107%2fclustering-points-and-summing-up-attributes-per-cluster-in-qgis%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
I would try K-means clustering algorithm in the QGIS Processing Toolbox (under Vector analysis
group).
Just by setting the Number of clusters
as 4, it will produce a new Clusters
layer with an attribute field CLUSTER_ID (values= 0, 1, 2, 3
).
Then an expression like SUM("yield", "CLUSTER_ID")
in the Field Calculator will return the total yield for each cluster. (E.G. the Sum_per_Cluster
in the below example).
[Update]
To obtain center point per the group (cluster), please try Mean coordinate(s) geoalgorithm in Processing Toolbox > Vector analysis
.
Mean coordinates dialog window will show an option Unique ID field. Select CLUSTER_ID
field.
Thank you very much for the quick and helpful reply! How did you create the center points of the clusters? When I use the method I described in my initial post (using"Symbology"
and"Cluster"
), I get center points completely off the actual cluster center (see [ibb.co/VmkhS0x]). This may stem from the different calculation methods. What approach did you use in your example? Furthermore, I get a lot of "NULL" results when I do the K-means clustering (see [ibb.co/VNdQ7bS]). Do you have a solution for this issue? Thank you very much!
– cbr
Mar 29 at 14:16
Since I only get error pages when trying to access the uploaded images but cannot edit the comment anymore (>5 min), here other links: Cluster center -> imgur.com/a/fs3R1K1 ; NULL -> imgur.com/a/Cv7IuCr
– cbr
Mar 29 at 14:23
@cbr To create center point for each cluster, please useCentroids
geoalgorithm. I will update my post. As to the center points (red circles) in my example, they werePoint cluster
symbology just for comparison.
– Kazuhito
Mar 29 at 21:47
@cbr Your upperleft (north western) cluster in the provided image has only two locations in that cluster, which does not seem right. (You would not build shed just for those two). I am not sure what happened with locations with NULL outputs; they may be outliers. Perhaps I would check their locations visually, and manually assign most appropriate cluster id.
– Kazuhito
Mar 29 at 22:03
Thanks very much for your reply! Thecentroids
algorithm only returns the same location for each of the selected points (so the output is a layer with the same amount of points as the input layer). I assume that the center point for each point was calculated but not one single point for the whole cluster... Is there another intermediate step necessary I made have missed?
– cbr
Mar 30 at 7:33
|
show 5 more comments
I would try K-means clustering algorithm in the QGIS Processing Toolbox (under Vector analysis
group).
Just by setting the Number of clusters
as 4, it will produce a new Clusters
layer with an attribute field CLUSTER_ID (values= 0, 1, 2, 3
).
Then an expression like SUM("yield", "CLUSTER_ID")
in the Field Calculator will return the total yield for each cluster. (E.G. the Sum_per_Cluster
in the below example).
[Update]
To obtain center point per the group (cluster), please try Mean coordinate(s) geoalgorithm in Processing Toolbox > Vector analysis
.
Mean coordinates dialog window will show an option Unique ID field. Select CLUSTER_ID
field.
Thank you very much for the quick and helpful reply! How did you create the center points of the clusters? When I use the method I described in my initial post (using"Symbology"
and"Cluster"
), I get center points completely off the actual cluster center (see [ibb.co/VmkhS0x]). This may stem from the different calculation methods. What approach did you use in your example? Furthermore, I get a lot of "NULL" results when I do the K-means clustering (see [ibb.co/VNdQ7bS]). Do you have a solution for this issue? Thank you very much!
– cbr
Mar 29 at 14:16
Since I only get error pages when trying to access the uploaded images but cannot edit the comment anymore (>5 min), here other links: Cluster center -> imgur.com/a/fs3R1K1 ; NULL -> imgur.com/a/Cv7IuCr
– cbr
Mar 29 at 14:23
@cbr To create center point for each cluster, please useCentroids
geoalgorithm. I will update my post. As to the center points (red circles) in my example, they werePoint cluster
symbology just for comparison.
– Kazuhito
Mar 29 at 21:47
@cbr Your upperleft (north western) cluster in the provided image has only two locations in that cluster, which does not seem right. (You would not build shed just for those two). I am not sure what happened with locations with NULL outputs; they may be outliers. Perhaps I would check their locations visually, and manually assign most appropriate cluster id.
– Kazuhito
Mar 29 at 22:03
Thanks very much for your reply! Thecentroids
algorithm only returns the same location for each of the selected points (so the output is a layer with the same amount of points as the input layer). I assume that the center point for each point was calculated but not one single point for the whole cluster... Is there another intermediate step necessary I made have missed?
– cbr
Mar 30 at 7:33
|
show 5 more comments
I would try K-means clustering algorithm in the QGIS Processing Toolbox (under Vector analysis
group).
Just by setting the Number of clusters
as 4, it will produce a new Clusters
layer with an attribute field CLUSTER_ID (values= 0, 1, 2, 3
).
Then an expression like SUM("yield", "CLUSTER_ID")
in the Field Calculator will return the total yield for each cluster. (E.G. the Sum_per_Cluster
in the below example).
[Update]
To obtain center point per the group (cluster), please try Mean coordinate(s) geoalgorithm in Processing Toolbox > Vector analysis
.
Mean coordinates dialog window will show an option Unique ID field. Select CLUSTER_ID
field.
I would try K-means clustering algorithm in the QGIS Processing Toolbox (under Vector analysis
group).
Just by setting the Number of clusters
as 4, it will produce a new Clusters
layer with an attribute field CLUSTER_ID (values= 0, 1, 2, 3
).
Then an expression like SUM("yield", "CLUSTER_ID")
in the Field Calculator will return the total yield for each cluster. (E.G. the Sum_per_Cluster
in the below example).
[Update]
To obtain center point per the group (cluster), please try Mean coordinate(s) geoalgorithm in Processing Toolbox > Vector analysis
.
Mean coordinates dialog window will show an option Unique ID field. Select CLUSTER_ID
field.
edited Mar 30 at 21:36
answered Mar 29 at 8:43
KazuhitoKazuhito
16.3k41884
16.3k41884
Thank you very much for the quick and helpful reply! How did you create the center points of the clusters? When I use the method I described in my initial post (using"Symbology"
and"Cluster"
), I get center points completely off the actual cluster center (see [ibb.co/VmkhS0x]). This may stem from the different calculation methods. What approach did you use in your example? Furthermore, I get a lot of "NULL" results when I do the K-means clustering (see [ibb.co/VNdQ7bS]). Do you have a solution for this issue? Thank you very much!
– cbr
Mar 29 at 14:16
Since I only get error pages when trying to access the uploaded images but cannot edit the comment anymore (>5 min), here other links: Cluster center -> imgur.com/a/fs3R1K1 ; NULL -> imgur.com/a/Cv7IuCr
– cbr
Mar 29 at 14:23
@cbr To create center point for each cluster, please useCentroids
geoalgorithm. I will update my post. As to the center points (red circles) in my example, they werePoint cluster
symbology just for comparison.
– Kazuhito
Mar 29 at 21:47
@cbr Your upperleft (north western) cluster in the provided image has only two locations in that cluster, which does not seem right. (You would not build shed just for those two). I am not sure what happened with locations with NULL outputs; they may be outliers. Perhaps I would check their locations visually, and manually assign most appropriate cluster id.
– Kazuhito
Mar 29 at 22:03
Thanks very much for your reply! Thecentroids
algorithm only returns the same location for each of the selected points (so the output is a layer with the same amount of points as the input layer). I assume that the center point for each point was calculated but not one single point for the whole cluster... Is there another intermediate step necessary I made have missed?
– cbr
Mar 30 at 7:33
|
show 5 more comments
Thank you very much for the quick and helpful reply! How did you create the center points of the clusters? When I use the method I described in my initial post (using"Symbology"
and"Cluster"
), I get center points completely off the actual cluster center (see [ibb.co/VmkhS0x]). This may stem from the different calculation methods. What approach did you use in your example? Furthermore, I get a lot of "NULL" results when I do the K-means clustering (see [ibb.co/VNdQ7bS]). Do you have a solution for this issue? Thank you very much!
– cbr
Mar 29 at 14:16
Since I only get error pages when trying to access the uploaded images but cannot edit the comment anymore (>5 min), here other links: Cluster center -> imgur.com/a/fs3R1K1 ; NULL -> imgur.com/a/Cv7IuCr
– cbr
Mar 29 at 14:23
@cbr To create center point for each cluster, please useCentroids
geoalgorithm. I will update my post. As to the center points (red circles) in my example, they werePoint cluster
symbology just for comparison.
– Kazuhito
Mar 29 at 21:47
@cbr Your upperleft (north western) cluster in the provided image has only two locations in that cluster, which does not seem right. (You would not build shed just for those two). I am not sure what happened with locations with NULL outputs; they may be outliers. Perhaps I would check their locations visually, and manually assign most appropriate cluster id.
– Kazuhito
Mar 29 at 22:03
Thanks very much for your reply! Thecentroids
algorithm only returns the same location for each of the selected points (so the output is a layer with the same amount of points as the input layer). I assume that the center point for each point was calculated but not one single point for the whole cluster... Is there another intermediate step necessary I made have missed?
– cbr
Mar 30 at 7:33
Thank you very much for the quick and helpful reply! How did you create the center points of the clusters? When I use the method I described in my initial post (using
"Symbology"
and "Cluster"
), I get center points completely off the actual cluster center (see [ibb.co/VmkhS0x]). This may stem from the different calculation methods. What approach did you use in your example? Furthermore, I get a lot of "NULL" results when I do the K-means clustering (see [ibb.co/VNdQ7bS]). Do you have a solution for this issue? Thank you very much!– cbr
Mar 29 at 14:16
Thank you very much for the quick and helpful reply! How did you create the center points of the clusters? When I use the method I described in my initial post (using
"Symbology"
and "Cluster"
), I get center points completely off the actual cluster center (see [ibb.co/VmkhS0x]). This may stem from the different calculation methods. What approach did you use in your example? Furthermore, I get a lot of "NULL" results when I do the K-means clustering (see [ibb.co/VNdQ7bS]). Do you have a solution for this issue? Thank you very much!– cbr
Mar 29 at 14:16
Since I only get error pages when trying to access the uploaded images but cannot edit the comment anymore (>5 min), here other links: Cluster center -> imgur.com/a/fs3R1K1 ; NULL -> imgur.com/a/Cv7IuCr
– cbr
Mar 29 at 14:23
Since I only get error pages when trying to access the uploaded images but cannot edit the comment anymore (>5 min), here other links: Cluster center -> imgur.com/a/fs3R1K1 ; NULL -> imgur.com/a/Cv7IuCr
– cbr
Mar 29 at 14:23
@cbr To create center point for each cluster, please use
Centroids
geoalgorithm. I will update my post. As to the center points (red circles) in my example, they were Point cluster
symbology just for comparison.– Kazuhito
Mar 29 at 21:47
@cbr To create center point for each cluster, please use
Centroids
geoalgorithm. I will update my post. As to the center points (red circles) in my example, they were Point cluster
symbology just for comparison.– Kazuhito
Mar 29 at 21:47
@cbr Your upperleft (north western) cluster in the provided image has only two locations in that cluster, which does not seem right. (You would not build shed just for those two). I am not sure what happened with locations with NULL outputs; they may be outliers. Perhaps I would check their locations visually, and manually assign most appropriate cluster id.
– Kazuhito
Mar 29 at 22:03
@cbr Your upperleft (north western) cluster in the provided image has only two locations in that cluster, which does not seem right. (You would not build shed just for those two). I am not sure what happened with locations with NULL outputs; they may be outliers. Perhaps I would check their locations visually, and manually assign most appropriate cluster id.
– Kazuhito
Mar 29 at 22:03
Thanks very much for your reply! The
centroids
algorithm only returns the same location for each of the selected points (so the output is a layer with the same amount of points as the input layer). I assume that the center point for each point was calculated but not one single point for the whole cluster... Is there another intermediate step necessary I made have missed?– cbr
Mar 30 at 7:33
Thanks very much for your reply! The
centroids
algorithm only returns the same location for each of the selected points (so the output is a layer with the same amount of points as the input layer). I assume that the center point for each point was calculated but not one single point for the whole cluster... Is there another intermediate step necessary I made have missed?– cbr
Mar 30 at 7:33
|
show 5 more comments
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%2f317107%2fclustering-points-and-summing-up-attributes-per-cluster-in-qgis%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