calculating area
r-sig-geo-bounces at stat.math.ethz.ch wrote on 2007-01-26 00:34:22:
On Fri, 26 Jan 2007, Pedro S. A. Wolf wrote:
I am a psychology student who has been using R to analyze
experimental data
mainly within the general linear model for about 2 years. I have
some
working knowledge with R, but by no means would call myself
proficient so
bear with me. Currently I'm running a series of experiments dealing
with
spatial data. I'm tracking peoples movements using gps units which
give me
latitude, heading, longitude, speed, altitude, and time variables.
I have
been using the packages "maps" and "mapproj" to plot the routes
which these
individuals take which is a great visualization tool. I would like
to know
if there is a package or set of commands which would calculate the
area
these people occupy? So far the closest I have been able to get to accomplishing this task is basically taking the max and min for both
lat and
long coordinates and calculating the size of that area, but I would
like
something more accurate. Another thing I'm trying to accomplish is
creating
what I would call a density map. This is probably not the correct
term so
let me explain what I mean. I'm trying to characterize how people
occupy
space. Especially how people visit certain places more than others.
Is
there a way to create a map which shows the amount of times a
particular
place is visited by these people both within subjects and a second
map
between subjects? Help would be greatly appreciated, as my academic
advisors
know next to nothing about working with this type of data.
If you think of including humans as animals, you'll find that field scientists, for example ecologists, do this a good deal - see the
package
adehabitat, perhaps function NNCH.area for Home Range Area. The
package
trip also provides tools for handling spurious GPS reports. You may
find
that you need to transform the GPS coordinates from geographical to projected to make area calculation easier, and that maps and mapproj
will
limit what you can do, perhaps consider moving to sp, maptools and
rgdal.
(There will be an R spatial workshop at the Association of American Geographers conference in San Francisco on Tuesday 17 April; the
"tape" of
Edzer Pebesma's eSeminar on R spatial classes and methods is not yet online, but we'll post when it is ready: http://www.wun.ac.uk/ggisa/seminars/archive/2006_program/index.html is where it should turn up). Roger
Depending on where on earth your data are from, the area calculations may be confounded by the spherical (or ellipsoidal) shape of the earth. So think about using the difference in longitude as you approach the poles. If your data are from a small area and you are only interested in relative differences in area then the geographic coordinates may be sufficient, otherwise you may want to check out a web site on map projections and choose one that will give you good area fidelity. One class of map projections has the property called equal-area, and preserves, in the plane of the projection, the area relationships on the spherical (or ellipsoidal) earth. Denis
Pedro