[R-sig-Geo] spherical polygon
Matthew Vavrek
matthew at matthewvavrek.com
Sun Feb 7 22:37:00 CET 2010
Hello,
I have a question that I have yet to find a definitive answer for on
this mailing list (or elsewhere as of yet) about a method of calculating
the area of a spherical polygon (ie an area on the surface of the
earth). I know of the areapl() function in the splancs package, although
as I understand it can only calculate the area of a planar polygon, not
a spherical one. The polygons I'm trying to calculate are generally
simple and convex; is there any way of doing this in R?
Also, I would like to get some feedback on a function that I wrote
myself that does this (although not perfectly). The function is called
earth.poly() and can be found in the fossil package on CRAN. Right now,
it can only deal with areas less than one hemisphere in size, and I
haven't stress tested it too much yet. Also, it treats the earth as a
sphere rather than a true ellipsoid for simplicity, which can mean up to
a 0.2% error in actual area (although it is generally much less).
Basically though, if anyone knows of something better out there already,
I would gladly use that instead, rather than spending far too much time
doing it myself.
Cheers
Matthew
More information about the R-sig-Geo
mailing list