824 reputation
26
bio website
location
age
visits member for 2 years, 9 months
seen 2 hours ago

2d
answered Rasterize gives weird image
2d
comment Rasterize gives weird image
yes, use readOGR, or with a simpler interface 'shapefile' in raster, because then you get the coordinate reference system of the data. A resolution of 1 is clearly not useful. What you are seeing is a map of one raster cell that has a single value (36). So do change the resolution to 100 cells and the results really should be different.
Apr
16
comment How to compute layer by layer after stack?
Why do you ask the same question at the same time on two different forums (here, and stackoverflow)??? I answered on stackoverflow: stackoverflow.com/questions/29651155/…
Apr
12
comment Getting latitude and longitude raster from DEM
It is not relevant to show the results on different platforms if the problem is that you are using an old version. You should update the package (and show sessionInfo() ). Perhaps the example in note 3 works, but it very convoluted. You could do lon = setValues(r, coor[,1])
Mar
19
comment Getting latitude and longitude raster from DEM
That probably means that you are using an old version of R/raster.
Mar
19
comment How to extract values from rasters at location of points in R?
@JMCosta: you are wrong about that. NA values would be returned for those points.
Mar
19
answered Conditional statement, apply different equation based on raster value R
Mar
18
revised Convert line shapefile to raster, value=total length of lines within cell
added 8 characters in body
Mar
18
revised Convert line shapefile to raster, value=total length of lines within cell
added 38 characters in body
Mar
18
answered How to compute climatology of 3 days moving averages for rasters pixel by pixel?
Mar
18
answered Convert line shapefile to raster, value=total length of lines within cell
Mar
15
comment How calculate pixel by pixel the mode (statistic) of multiple rasters (geotiff)?
You can also do: mclass <- calc(r, modal)
Mar
15
comment How can I identify lines that intersect a certain raster layer area?
converting raster data to polygons is rarely a good idea. I would use R/raster package function 'rasterize' to count the number of lines that cross each cell and then 'mask' to only keep the cells that are of interest.
Mar
15
answered Getting latitude and longitude raster from DEM
Mar
15
comment How to load projection along with raster in R?
@AndreSilva. Yes you are right; i misunderstood your answer.
Mar
11
comment How to load projection along with raster in R?
To write a prj file, you can do: writeLines(showWKT(crs(x, asText=TRUE)), extension(filename, 'prj') ) where x is the Raster object with a crs, and filename is the ascii file you are writing to. Hence most of the steps shown above can be omitted.
Mar
11
comment How to load projection along with raster in R?
This should work as illustrated below by xunilk. Perhaps you need to update R and or rgdal (and perhaps gdal if you are not on windows).
Mar
11
awarded  Commentator
Mar
11
comment How to load projection along with raster in R?
This is about writing a prj file. The questions is about reading it.
Jan
26
answered How to reclassify a float raster?