Re: [R-sig-Geo] plotKML tutorials for creating a times series from rasters?

2012-10-03 Thread Tomislav Hengl
On 02/10/2012 21:21, nikos ves wrote: Hi list, I was browsing the list and I found out about plotKML. It seems a nice way to present your data, or do a visual inspection. I tried to create a timeseries visualization from an environmental index Im studying at the moment (55 geotiffs ~35 MB

Re: [R-sig-Geo] plotKML tutorials for creating a times series from rasters?

2012-10-03 Thread Tomislav Hengl
On 03/10/2012 00:17, nikos ves wrote: An update : After some experiments, I have created a rasterbrick with 55 layers. ( By stitching 55 geotif's into a vrt using gdal [$gdalbuildvrt -separate -o tmp.vrt *.tif]) mBrick = brick(/path/to/vrt) Afterwards when I was trying to create the ts

[R-sig-Geo] Error: NA/NaN/Inf in foreign function call (arg 7) while using Predict function with Raster

2012-10-03 Thread aniruddha ghosh
Dear List, I'm trying to classify a multiband raster with point shapefiles as training data. I used the following: vec-readOGR(.,training) raster-stack(test.tif) #it contains around 10 pixels and 240 layers outImage-classified.tif #then extract the training values train-extract(raster,vec)

Re: [R-sig-Geo] [raster newbie] projectRaster hangs regridding global latlong - CONUS LCC

2012-10-03 Thread Tom Roche
summary: Robert Hijmans' advice fixed my hang, but now I'm getting very wrong output--i.e., input variables are not preserved. How to get the appropriate output schema (e.g., data variables)? details: https://stat.ethz.ch/pipermail/r-sig-geo/2012-October/016215.html My current [NetCDF] input

[R-sig-Geo] Writing Raster values to .txt file

2012-10-03 Thread Tiffany Smith
Hello, I'm trying to write out the values of a RasterBrick to a .txt file. Here's what I have: b-brick(file1.nc) vals-getValues(b) write.table(vals,file1.txt) Where 'b' is a RasterBrick with dimensions [224,464,33] which corresponds to [lat,lon,time]. The output, 'vals' has dimensions

Re: [R-sig-Geo] projectRaster() produces an object with no values

2012-10-03 Thread rr2box42
I am having the same problem as the OP. I understand Robert's response, but I don't think it applies to my situation. Any ideas? Here are my rasters: from.rast class : RasterLayer band: 2 dimensions : 96, 192, 18432 (nrow, ncol, ncell) resolution : 1.875,

[R-sig-Geo] Antw: Writing Raster values to .txt file

2012-10-03 Thread Matteo Mattiuzzi
Hi, the only way I can see is to use ?xyFromCell r - raster() r[] - 1:ncell(r) r - brick(r,r*2) vals - getValues(r) coords - xyFromCell(r,1:ncell(r)) res - cbind(coords,vals) write.table(res,file1.txt) Matteo Tiffany Smith 03.10.12 22.34 Uhr Hello, I'm trying to write out the

Re: [R-sig-Geo] projectRaster() produces an object with no values

2012-10-03 Thread rr2box42
Oh, I see. My 'from.rast' extent is given from (0,360) degrees longitude, rather than (-180, 180). I fixed that per this thread: https://stat.ethz.ch/pipermail/r-sig-geo/2011-March/011155.html And then the projection works fine. -- View this message in context:

[R-sig-Geo] Extract location information from grid cells for sample points [SEC=UNCLASSIFIED]

2012-10-03 Thread Jin . Li
Dear list, I have two datasets: one is for point samples with lat and long information at accuracy of 0.001 degrees. Another is grid cells at a resolution of 0.0025 degrees. Both datasets are in txt format. Now I need to extract the lat and long information from the grid cell dataset for the

Re: [R-sig-Geo] Extract location information from grid cells for sample points [SEC=UNCLASSIFIED]

2012-10-03 Thread Thomas Adams
Jin, I'd be willing to wager it can be done in R alone as someone is sure to point out, but since you're using R (and so, willing to go the open source route), you may be willing to take another step and use GRASS GIS ( http://grass.osgeo.org) — the wonderful thing about this is that your problem

[R-sig-Geo] Geographical Interpolation functions

2012-10-03 Thread Camilo Mora
Hi I am comparing different interpolation methods on climate data. I have found quite a few functions (e.g. spline and kriging) but I wonder if Nearest-neighbor interpolation and Natural neighbor function are available in an R package? Thanks, Camilo Camilo Mora, Ph.D. Department of

Re: [R-sig-Geo] Antw: Writing Raster values to .txt file

2012-10-03 Thread Robert J. Hijmans
Tiffany, You can also use r - raster() r[] - 1:ncell(r) r - brick(r,r*2) p - rasterToPoints(r) write.table(p, file2.txt) This will add the x and y, but omit NA cells. It also allows to you to use an expression to subset the values you want (e.g. only values 0) Robert On Wed, Oct 3, 2012 at

Re: [R-sig-Geo] [raster newbie] projectRaster hangs regridding global latlong - CONUS LCC

2012-10-03 Thread Robert J. Hijmans
Tom, I do not know why you say the output is wrong. Why you would expect that input variables would have to be preserved (copied to the output file)? For 'raster' there is input data and output data, the input and output files (formats, attributes) are not related in any way. You could use the

Re: [R-sig-Geo] Extract location information from grid cells for sample points [SEC=UNCLASSIFIED]

2012-10-03 Thread Jin . Li
Hi Robert, Thank you very much for the reply. Both datasets are in txt format. Lat and long are in WGS84. So I might need to do something like: library(raster) p - read.table('points.txt') d - read.table('gridcells.txt') r - rasterFromPoints(d) values- extract(r, p) Is anything else I should

Re: [R-sig-Geo] Error: NA/NaN/Inf in foreign function call (arg 7) while using Predict function with Raster

2012-10-03 Thread Robert J. Hijmans
Ani, The raster::predict function has na.rm=TRUE and removes the NA values, but not -Inf/Inf values and that indeed seems to be the problem here (see example below). I have added an option inf.rm to the predict function of the development version of 'raster' (version 2.0-20) you can try to

Re: [R-sig-Geo] Extract location information from grid cells for sample points [SEC=UNCLASSIFIED]

2012-10-03 Thread Robert J. Hijmans
On Wed, Oct 3, 2012 at 9:20 PM, jin...@ga.gov.au wrote: ** ** ** ** ** ** Hi Robert, Thank you very much for the reply. Both datasets are in txt format. Lat and long are in WGS84. So I might need to do something like: library(raster) p - read.table('points.txt') d -