Ross, what you want is subsetting, not extraction.
have you tried:
newSPDF <- columbus[30,]
Reading introductory material such as
http://cran.r-project.org/web/packages/sp/vignettes/intro_sp.pdf
is also a good way to learn the first steps.
Bests,
On 03/29/2013 04:32 PM, Ross Ahmed wrote:
> Le
Lets say I have a several polygons stored in a SpatialPolygonsDataFrame
object. Using columbus¹ in maptools as an example:
setwd(system.file("shapes", package="maptools"))
columbus <- readShapeSpatial("columbus.shp²)
I want to extract a polygon 30 from columbus¹, and assign it to a new
SpatialP
Spencer,
After some tinkering... you could reclass to get single class (land cover
type) layer, then aggregate, then extract. For me, that takes about 4 hours
per class.
> rcl <- matrix(c(11,12,1, 21,100,0), byrow=T, ncol=3)
> system.time(cls11_12 <- reclass(env, rcl, right=FALSE,
filename='class
Spencer,
That is an interesting challenge. Your approaches are fine in principle,
but you have a raster of 30 meter resolution for the conterminous US ( ~17
billion cells ) and, if I understand you well, you want to tabulate the
values by polygon, using irregular polygons (relative to the raster)
WOW!
I appreciate the insight. I constantly need rasterize. but have very little
working knowledge of using it.
I guess patience is the first ingredient.
brad
On Mon, Jun 18, 2012 at 6:07 PM, Spencer Scheidt wrote:
> Hello,
>
> I am attempting to extract land cover values from the NLCD 2006 da
You might also want to consider using PostGIS [1], which now handles
rasters by default in the recent 2.0 version, and was precisely developed
to handle large maps easily. Note that it uses GDAL for some raster
functions, so that it might not be faster than GDAL itself...
Mathieu.
[1] http://
Spencer, it's been awhile since I tried to use rasterize(), but when I
did, I found it very slow compared to alternative approaches, e.g. using
ArcGIS. In the end, I discovered gdal_rasterize (
http://www.gdal.org/gdal_rasterize.html), which seems to be faster,
although I've never compared th
Hello,
I am attempting to extract land cover values from the NLCD 2006 dataset
(http://www.mrlc.gov/nlcd2006.php) using a grid that I have converted into a
SpatialPolygons* object. However, the NLCD raster is approximately 16 GB in
size (30 m resolution), and the grid that I would like to work wi