Skip to content

extracting values from rasters

5 messages · Barry Rowlingson, Camilo Mora, Robert J. Hijmans

#
On Sun, Oct 7, 2012 at 7:56 AM, Camilo Mora <cmora at dal.ca> wrote:
You want to start off looking at the 'resample' function in the
raster package. Read the note at the start of that about other
possibilities. Since your cells don't line up, there's various ways of
deciding what the value for a target cell is, including just sampling
the centre points, or interpolating overlapping cells in various ways.

Barry
#
Thanks Barry,

I did try resample. Unfortunately, it is taking about 15 minutes and  
after that it says that it failed returning the message "Reached total  
allocation of 5813Mb: see help(memory.size)".

I converted my habitat raster to points (about 500,000) and use the  
"extract" fucntion. it does the extraction in about two minutes, which  
makes me realize that the resample function is taking to long because  
of the interpolation method.

Do you know if there is an analogous function to resample that  
considers just the overlap of cells to assing values?.

Thanks,


Camilo
http://www.soc.hawaii.edu/mora/



Quoting Barry Rowlingson <b.rowlingson at lancaster.ac.uk>:
#
Thanks Robert,

I am exploring an option suggested by Barry and would like to explore  
yours to. A question I have though is how to use "extract" to a  
raster. According to the instructions extract takes the data from a  
raster on the areas overlapping polygons, lines, points and extents.  
But not info on other rasters. Is there a trick to extract to another  
raster?

Thanks,

Camilo


Camilo Mora, Ph.D.
Department of Geography, University of Hawaii
Currently available in Colombia
Phone:   Country code: 57
          Provider code: 313
          Phone 776 2282
          From the USA or Canada you have to dial 011 57 313 776 2282
http://www.soc.hawaii.edu/mora/



Quoting "Robert J. Hijmans" <r.hijmans at gmail.com>:
2 days later