[R-sig-Geo] Intersect shapefiles
Worrall, James -FS
jworrall at fs.fed.us
Thu Feb 18 19:10:10 CET 2016
Such a clear and simple explanation - thank you. I wish the function documentation was written like that.
From: Alex Mandel [mailto:tech_dev at wildintellect.com]
Sent: Thursday, February 18, 2016 9:59 AM
To: Worrall, James -FS <jworrall at fs.fed.us>; chris english <englishchristophera at gmail.com>; A. Marcia BARBOSA <barbosa at uevora.pt>
Cc: Help R-Sig_Geo <r-sig-geo at r-project.org>
Subject: Re: [R-sig-Geo] Intersect shapefiles
Union creates a merged shape including all parts of input objects.
Intersection creates a shape of the overlapping portions of input objects.
I'm not clear on the goal from the initial email so I don't know which is better in this case.
On 02/18/2016 07:55 AM, Worrall, James -FS wrote:
> I would have thought gUnaryUnion, but then I can't understand from the documentation what the difference is between that and gIntersection.
> -----Original Message-----
> From: R-sig-Geo [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of
> chris english
> Sent: Thursday, February 18, 2016 7:24 AM
> As Loic suggests, rgeos::gIntersection will get you there. Look closely at his naming of objects and your example code using spTransform. With his approach, each object has its own name; whereas your approach overwrites Rain_poly_merge the second and third time and the final object (third) is the 2008 maize yield. So read your shapefiles into differently named objects and use Loic's approach.
> This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
More information about the R-sig-Geo