If I understand your problem. You can compute a global centroid for the large
polygon directly as a weighted average.
If Pi is the population of block i
and (xi, yi) are the coordinates of the centroid of block i.
the weighted average centroid of the polygon will be:
x_w = sum(xi*Pi)/sum(Pi)
Hi Loïc,
Thank you so much for your reply. I went through the approach that you have
already proposed. I believe it's a great idea.
I'd like to emphasize that the coordinates of the centroid of each block is
available. The idea is how to relate these centroids to the corresponding
population
Hi Sohrab,
I don't think there is a method for weighted centroids specifically.
What if you get the centroid coordinates of each "block" using
gCentroid() and calculate a weighted average of the coordinates of every
centroid?
See an example below assuming your blocks are a
Dear all,
I have a set of spatial polygons and several blocks of population (with fixed
area but a different number of people in each). I have used the "over" method
from "sp" package to identify the blocks which are located inside these
polygons.
Now, utilizing R, I wish to assign to each of
On Tue, Mar 6, 2012 at 1:49 AM, Zia Ahmed z...@cornell.edu wrote:
Is there anyway to calculate population weighted centroids of a spatial
polygon in R? Any idea will be appreciated. Thanks
Some more clues would be appreciated! What's your data? A set of
points representing cities with
Is there anyway to calculate population weighted centroids of a spatial
polygon in R? Any idea will be appreciated. Thanks
Zia
--
-
Zia Ahmed, PhD
Research Associate
Department of Crop and Soil Sciences
1002 Bradfield Hall, Cornell University
Ithaca, NY 14853-4203
t.