123. TP: 483)
-Original Message-
From: r-sig-geo-boun...@stat.math.ethz.ch
[mailto:r-sig-geo-boun...@stat.math.ethz.ch] On Behalf Of Johannes Signer
Sent: Thursday, October 14, 2010 5:39 PM
To: Manuel Spínola
Cc: r-sig-geo@stat.math.ethz.ch
Subject: Re: [R-sig-Geo] Clip a raster
Hi
Dear All,
I have been using the crop function in the raster package, but haven't
figured out yet how this function deals with pixels that falls on the edge
of a polygon.
Thanks,
Paulo
On Thu, Oct 14, 2010 at 12:42 PM, Manuel Spínola mspinol...@gmail.comwrote:
Thank you very much Robert.
Paulo,
If the polygon does not cover half the edge-pixel, it is ignored. That
should probably change so that all cells that are touched are
included.
To be safe you could use a slightly larger extent, as in:
e - intersectExtent(x, extent(y)) + 2 * xres(x)
crop(x, e)
Robert
On Fri, Oct 15,
Dear list members,
I download bioclim data in a raster format (estension: .bil) and I would
like to clip the variables to a ploygon stored as a shapefile (Costa
Rica outline).
How can I do that?
I read the raster file like this:
x - readGDAL(bio1_23.bil)
Thank you very much in advance.
Hi,
with the raster package you could use: polygons to raster
(?polygonsToRaster), converting the Costa Rica shapefile to a raster
and then use mask (?mask).
Best
Johannes
On Thu, Oct 14, 2010 at 5:16 PM, Manuel Spínola mspinol...@gmail.com wrote:
Dear list members,
I download bioclim data
Manuel,
if costarica is a SpatialPolygons* object, you can do:
r - raster(bio1_23.bil)
cr - crop(r, costarica)
Robert
On Thu, Oct 14, 2010 at 8:16 AM, Manuel Spínola mspinol...@gmail.com wrote:
Dear list members,
I download bioclim data in a raster format (estension: .bil) and I would
Thank you Roman and Johannes,
What I am doing wrong?
x - readGDAL(bio1_23.bil)
xr = raster(x)
map - readOGR(dsn=C:/ProyectoRespacial/EvalHab_reporte,
layer=Cr_wgs84_meso) # shapefile
r2 - polygonsToRaster(map, xr)
Found 1 region(s) and 1 polygon(s)
Error: no se puede ubicar un vector de
Thank you very much Robert.
That's works perfect.
Manuel
On 14/10/2010 10:21 a.m., Robert J. Hijmans wrote:
Manuel,
if costarica is a SpatialPolygons* object, you can do:
r- raster(bio1_23.bil)
cr- crop(r, costarica)
Robert
On Thu, Oct 14, 2010 at 8:16 AM, Manuel
Etienne,
I added a function clickBbox to the raster package for increased interactivity
#install.packages(raster, repos=http://R-Forge.R-project.org;)
require(raster)
# read a raster file from disk
filename - system.file(pictures/Rlogo.jpg, package=rgdal)
r - rasterFromFile(filename, TRUE)
On Tue, 3 Feb 2009, Etienne Bellemare Racine wrote:
Is it possible to clip a raster after having it read with readGDAL ?
Instead of using region.dim() and offset(), I would like to clip it on
the fly to visualize statistics associated with objects of different
size. The clip is square
Is it possible to clip a raster after having it read with readGDAL ?
Instead of using region.dim() and offset(), I would like to clip it on
the fly to visualize statistics associated with objects of different
size. The clip is square -specified with upper left and lower right
corners- and fit
11 matches
Mail list logo