Skip to content

RASTER or RGDAL package

5 messages · Malik Shahzad, Carsten Neumann, Stratford, Jeffrey +1 more

#
Am 14.01.2011 15:13, schrieb Malik Shahzad:
Dear Malik,

to handle large datasets package raster is the best solution. Using 
rgdal causes memory error because data is directly read into memory. 
Especially multidimesnional remote sensing images are characterized by a 
huge amount of data that has to be processed. The package raster allows 
to read and process blocks of data from a path where your image is 
stored on disc. Additionally you can use rgdal drivers in raster  to 
store your processed image result in different formats.

With best regards

Carsten
#
Hi everyone,

Does anyone have any suggestions on sampling a raster (NLCD land cover
map, 30 m res) using circular buffers centered on 100+ sample points?

The NLCD map has classifications such as high density urban, medium
density urban, crop, etc.  The goal is to produce a data set with the
percent of each cover type for each point and relate this to biological
data (+/- blood parasites).  The next goal would be to extrapolate
parasitism probabilities throughout the landscape but that's a big next
step.  For now, I'd be happy to figure out how to extract data from the
NLCD map.

In the past I had been using raster calculator in ArcGIS/spatial analyst
but I would prefer to use open source software. I'm also a low-level
programmer - my specialty is the ecological side. 

Thanks,

Jeff

************************************
Dr. Jeffrey A. Stratford
Department of Health and Biological Sciences
84 W. South Street
Wilkes University, PA 18766
jeffrey.stratford at wilkes.edu
570-408-4761 (office)
570-332-2942 (cell)
http://web.wilkes.edu/jeffrey.stratford/
************************************
#
I would add that raster builds on rgdal, and so, if you use raster, in most
cases it would be raster & rgdal, with rgdal providing the basic file
reading and writing, and raster managing that to avoid memory problems, and
through a large number of additional functions that operate on raster data.
#
You can do:

library(raster)
r <- raster('filename')
extract(r, points, buffer=250)

where points is a two column matrix (x,y), or (inherits from) a
SpatialPoints object

Robert