Re: [R-sig-Geo] Aggregation and disaggregation in sf

2021-10-14 Thread Edzer Pebesma
I'm not so familiar with the terminology you use, but the function you'd 
most likely want to look into is st_interpolate_aw().


On 14/10/2021 12:11, Sean Trende wrote:

Thank you all for developing this package and taking a huge amount of time to answer 
questions.  I had a question that I found related answers to, but nothing directly on 
point.  Perhaps I'm just not being sufficiently creative with my R coding, and I 
apologize if I missed the "explainer" elsewhere.

A common task is aggregating and disaggregating within a larger polygon set.  I believe 
that I know how to do the following in the geomander package, but am wondering if there 
is a "pure" sf solution.

There is a simple version of the task, and a more complex one.

The simple version of task: You have two shapefiles, one of census blocks and 
one of precinct results. You have a polygon for a precinct that split 100 votes 
to 100 votes for candidates A and B in the preceding election. The precinct 
wholly contains three census blocks with respective populations of 100, 200 and 
300.

The task is to identify those blocks that exist within the precinct from the 
broader block shapefile and then to apportion the votes among these census 
blocks proportional to population, such that you would have 16.6, 33.3, and 50 
votes recorded at the block level for each candidate, respectively.

The more difficult version: Same facts, but now there is a 4th block that is 
split between precincts. So there has to be some sort of way to acknowledge 
these blocks and split them, likely in an arbitrary way between the portion 
within the precinct and without (e.g., 50-50 or by land area within each 
precinct)

I wouldn't impose upon you to actually write code, but if I could be directed 
toward the most relevant functions (or told to go play around in ArcGIS) it 
would be incredibly helpful.

Best regards,

Sean

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



--
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] Aggregation and disaggregation in sf

2021-10-14 Thread Sean Trende
Thank you all for developing this package and taking a huge amount of time to 
answer questions.  I had a question that I found related answers to, but 
nothing directly on point.  Perhaps I'm just not being sufficiently creative 
with my R coding, and I apologize if I missed the "explainer" elsewhere.

A common task is aggregating and disaggregating within a larger polygon set.  I 
believe that I know how to do the following in the geomander package, but am 
wondering if there is a "pure" sf solution.

There is a simple version of the task, and a more complex one.

The simple version of task: You have two shapefiles, one of census blocks and 
one of precinct results. You have a polygon for a precinct that split 100 votes 
to 100 votes for candidates A and B in the preceding election. The precinct 
wholly contains three census blocks with respective populations of 100, 200 and 
300.  

The task is to identify those blocks that exist within the precinct from the 
broader block shapefile and then to apportion the votes among these census 
blocks proportional to population, such that you would have 16.6, 33.3, and 50 
votes recorded at the block level for each candidate, respectively.

The more difficult version: Same facts, but now there is a 4th block that is 
split between precincts. So there has to be some sort of way to acknowledge 
these blocks and split them, likely in an arbitrary way between the portion 
within the precinct and without (e.g., 50-50 or by land area within each 
precinct)

I wouldn't impose upon you to actually write code, but if I could be directed 
toward the most relevant functions (or told to go play around in ArcGIS) it 
would be incredibly helpful.

Best regards,

Sean

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo