[R-sig-Geo] extracting oceanographic data
Michael Sumner
mdsumner at utas.edu.au
Tue Jun 24 15:20:39 CEST 2008
Hello,
I've worked a lot on problems of this type - here's some quick thoughts,
not really directly addressing your questions.
HDF and netCDF can be difficult - you need to compile rgdal from against
FWTools, or from source to have those work with readGDAL. I would just
use gdal_translate to convert data to GeoTIFF (installing FWTools is
trivial). Those formats can offer further challenges, just in
interpreting the structure and content, but it depends on the actual
data you want to use.
A question to ask here is what is the service providing the data in the
first place? Ideally you can read directly from the server, but more
likely you have a local cache of files. (If you have these as netCDF/HDF
it's probably best to extract what you need to GeoTIFF using
gdal_translate. ) The kftools package provides a direct read for SST,
but it's a bit complicated. I had success with reading directly from the
service behind the NASA POET site, but that wasn't useful for many
datasets. I haven't explored the variety of services for some time,
apparently there is a NOAA service that covers most needs.
For getting a range of pixel values around each point I would use
overlay() in sp package, and work on creating circle polygons around
your locations.
You didn't mention the temporal aspect that you need when overlaying
track data with time series of oceanographic data, but this can be very
simple when using rgdal since all your time series layers can be stored
in one SpatialGridDataFrame dataset as separate attributes (depending on
the size) and you simply find the interval in which your locations fall
as well as the pixel for each location. Determining a spatial range
around these is more complicated but not greatly so. The power of
general indexing in R, along with the spatial extensions provided in sp
is very helpful here.
How are you determining an appropriate range to query around your track
locations? The tripEstimation package is a suite of functions written
for estimating position from raw archival tags or a remote service, and
I mention that as the outputs there can be very flexible for
spatial/temporal overlays when location precision is important (but may
be overkill here, and it's not user friendly).
The trip package extends the foundation provided by sp for track data,
so that also may be useful for dealing with sets of tracks.
I hope some of that is helpful - sorry I'm not addressing your questions
specifically. If you post more detail about the actual datasets you are
trying to deal with I may be able to help more.
Cheers, Mike.
LOUZAO wrote:
> Dear list,
>
> I'm trying to extract different oceanographic data (chlorophyll, sea
> surface temperature, etc.) for doing habitat modelling. The input data
> are locations (lat, lon) of tracking data of marine top predators and
> I would like to extract oceanographic data from a given area around
> each specific location, from which compute the median, maximum and
> minimum values of the corresponding data (sst, chl, etc.). For doing
> this,
>
> 1. I need to import the oceanographic data into R. Which format
> (ascii, hdf, netcdf,etc.) would you recommend? I have been working
> with ascii, importing files with import.asc().
> 2. For defining the area around each location, I could define a circle
> (radius of 1° in decimal degree) or a square (a total heigth of 1° in
> decimal degree) centered in each location.
> In the grid package, the circleGrob() or the viewport() fucntions
> provide this approach. However, I have applied the circleGrob but I do
> not reach to obtain a circle around each location (when I plot it I
> only obtain the same configuration than when plotting the locations).
> I think that I'm missing something related with the units. In this
> case, x and y are longitud and latitud in decimal degress.
>
> circle<-circleGrob(x=locs$Long, y=locs$Lat, r=2,
> default.units="native", name=NULL,
> gp=gpar(), vp=NULL)
>
> I have found other two functions that I do not know if someone has
> used for doing the same.
>
> - symbolsInPolys() in maptools
>
> - spsample() in sp
>
> 3. The last step would be to overlay the oceanographic layer and the
> object of circles (or squares) to extract the median, maximum and
> minimum values of the corresponding data (sst, chl, etc.)
>
> Has anybody worked on this problem? Could you please point to any
> useful documents?
> Thanks in advance,
>
> Maite Louzao
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 270.4.1/1515 - Release Date: 6/23/2008 7:16 PM
>
More information about the R-sig-Geo
mailing list