Re: [R-sig-Geo] Plot box is empty!!! Raster plot?

2011-12-13 Thread Robert J. Hijmans
Byman, I think this happens because all values in pr_a2_20c3m_1_cgcm3.1_t47_1961_2000.nc are NA. Robert On Tue, Dec 13, 2011 at 3:52 PM, Byman wrote: > *I am sorry if this has been answered before but I searched and found > no solution > * > > *I have a problem plotting maps using the raster

Re: [R-sig-Geo] Adding raster files from a folder

2011-12-13 Thread Robert J. Hijmans
> And I am sure someone can do this even shorter... fls = list.files('foldername') s <- stack(fls) Robert On Tue, Dec 13, 2011 at 5:24 AM, wrote: > Hi Sajid, > > You should be able to do something like this: > > setwd( name of folder) > fls = list.files() # you can add a pattern if you only wa

Re: [R-sig-Geo] Coordinate system specification

2011-12-13 Thread Robert J. Hijmans
Ray, It is probably "Teale-Albers" (the commonly used projection used in California) with NAD83 or NAD27 datum. "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-400 +ellps=GRS80 +units=m +datum=NAD83" or "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-

[R-sig-Geo] Coordinate system specification

2011-12-13 Thread Ray Danner
Dear community, I would like to calculate average values from a few hundred raster files and then query values for 217 specific points. The raster files are of evapotranspiration data in California (http://goes.casil.ucdavis.edu/cimis/). The maps have 2km resolution. I'm able to download the .a

[R-sig-Geo] general question on R squared for SAR models

2011-12-13 Thread Maryline PIOZ
Dear R-SIG-Ecolog users,   I have a general question regarding simultaneous autoregressive models (SAR models).   As a measure of global fit of the SAR models (and to compare different SAR models based on the same dataset) some authors use the Nagelkerke pseudo-R-squared and some other use

Re: [R-sig-Geo] Lat / Long - x/y?

2011-12-13 Thread Barry Rowlingson
On Tue, Dec 13, 2011 at 12:52 PM, Sam smith wrote: > Hi, > > Thanks for this - yes i was looking to do a Projection from Decimal Degrees > into spatial (xy) coordinates. > > I shall have a look at the package you suggested. You probably mean 'Cartesian x-y coordinates'. You'll need to find a coo

[R-sig-Geo] put coordinates back to polyline

2011-12-13 Thread Miaoying Shi
Dear list, a <- coordinates(polyline) . I added some random noise to "a", that is the coordinates of the polyline, but kept the length and format exactly as it was. Now the problem is how can I put the updated coordinates back to polyline? thanks a lot! Best, miaoying shi [[alternative

Re: [R-sig-Geo] Acessing slot information in spatialPolygon class

2011-12-13 Thread Rui Catarino
Hi Jon, Thank you for your quick reply, which solved the problem with just a small change in your line of code. Using the code below I get an error message: res$area2 = sapply(slot(res,"polygons"), function(x) slot(x, "area")) Error in `$<-`(`*tmp*`, "area2", value = c(0.000452308218606559, 0

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I just saw that email as well - I'll follow the same path. Thanks for posting this here, Cheers, Rainer On 13/12/11 14:27, Agustin Lobo wrote: > Well, after googling quite a bit, could not really find the exact > syntax for the configure.args in t

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Agustin Lobo
Well, after googling quite a bit, could not really find the exact syntax for the configure.args in this case, probably because of my inexperience on these issues. But, in parallel, another solution has been suggested by Julien Malik (see http://orfeo-toolbox.org/otb/) as he had had this problem fe

Re: [R-sig-Geo] Acessing slot information in spatialPolygon class

2011-12-13 Thread jon . skoien
Hi Rui, I think the following should give you what you are looking for: res$area2 = sapply(slot(res,"polygons"), function(x) slot(x, "area")) Cheers, Jon On 13-Dec-11 13:50, Rui Catarino wrote: Dear all, This may seem a very obvious question but I'm suck and for the past 2h I haven't been a

Re: [R-sig-Geo] Adding raster files from a folder

2011-12-13 Thread jon . skoien
Hi Sajid, You should be able to do something like this: setwd( name of folder) fls = list.files() # you can add a pattern if you only want files of a certain type dst = stack(fls[1]) for (ifile in 2:length(fls)) dst = addLayer(dst, raster(fls[ifile])) And I am sure someone can do this even sh

Re: [R-sig-Geo] Lat / Long - x/y?

2011-12-13 Thread Sam smith
Hi, Thanks for this - yes i was looking to do a Projection from Decimal Degrees into spatial (xy) coordinates. I shall have a look at the package you suggested. Sam On Tue, Dec 13, 2011 at 12:40 PM, Tom Gottfried wrote: > Hi Sam, > > Am 13.12.2011 13:27, schrieb Sam smith: > > Dear List i hav

[R-sig-Geo] Acessing slot information in spatialPolygon class

2011-12-13 Thread Rui Catarino
Dear all, This may seem a very obvious question but I'm suck and for the past 2h I haven't been able of solving the problem. So for the sake of productivity I'll ask for some help: I have a SpatialPolygon Class that looks like(see bellow) in the example below I have only 2 polygons but they

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/12/11 13:27, Agustin Lobo wrote: > 2011/12/13 Rainer M Krug : >> -BEGIN PGP SIGNED MESSAGE- If you install gdal in your >> home directory, you *can* leave the systemwide from repo >> installed, as several problems rely on it, but you have

Re: [R-sig-Geo] Lat / Long - x/y?

2011-12-13 Thread Tom Gottfried
Hi Sam, Am 13.12.2011 13:27, schrieb Sam smith: Dear List i have been provided spatial data in the format lat/lon and i have realised that alot of functions in R require x/y coordinates i.e. positive integers only. as far as I'm aware, coordinates are kept in numeric/double. I appreciate con

[R-sig-Geo] Lat / Long - x/y?

2011-12-13 Thread Sam smith
Dear List i have been provided spatial data in the format lat/lon and i have realised that alot of functions in R require x/y coordinates i.e. positive integers only. I appreciate converting between the two is hard, taking into account projection, especially on the global scale that i am working.

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Agustin Lobo
2011/12/13 Rainer M Krug : > -BEGIN PGP SIGNED MESSAGE- > If you install gdal in your home directory, you *can* leave the > systemwide from repo installed, as several problems rely on it, but > you have to set PATH and point rgdal to the installation of gdal in > the home directory. > Or a

Re: [R-sig-Geo] How to plot attributes of a shapefile?

2011-12-13 Thread Tom Gottfried
spplot(myLanduse, "GRIDCODE") regards, Tom Am 13.12.2011 12:10, schrieb Georg Hörmann: Hello World, I am somehow stuck with a simple GIS problem. I have a landuse map imported from ArcGIS in shapefile format. Everything is ok, but if I plot the map. it only plots the polygons without attribute

[R-sig-Geo] How to plot attributes of a shapefile?

2011-12-13 Thread Georg Hörmann
Hello World, I am somehow stuck with a simple GIS problem. I have a landuse map imported from ArcGIS in shapefile format. Everything is ok, but if I plot the map. it only plots the polygons without attributes. I want to plot the map with the attribute "GRIDCODE", which is the code for the landuse

[R-sig-Geo] Adding raster files from a folder

2011-12-13 Thread sajid pareeth
Hi I have number of raster files(more than 100) in a folder for which I want to do some zonal stats. My question is how to add these raster files into R environment. Is there any way to do that together? Like batch files, where we give the folder and all the files from that folder will be process

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/12/11 11:09, Agustin Lobo wrote: > Do you mean libgdal1-1.8 from ubuntugis-unstable? \ That is the culprit - yes. > This is what I have (I think, actually Synaptic does not tell you > from which repo the packages comes from and I do not know ho

[R-sig-Geo] spatial covariance in the glmm in brain data

2011-12-13 Thread Michael Klein
Dear List, I am a beginner or R (just started last week) and I am not exactly a freak in theoretical statistics, so please excuse me, if my questions are naive or contain mistakes. This might also not be your standard problem since it is about brain imaging data. However, it seems that I have to

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Agustin Lobo
Do you mean libgdal1-1.8 from ubuntugis-unstable? This is what I have (I think, actually Synaptic does not tell you from which repo the packages comes from and I do not know how to actually make sure my libgdal comes from). Also, what do you mean by "locking"? selecting "Mark Recommended for instal

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/12/11 10:46, Agustin Lobo wrote: > More details: the problem occurs with tif files only, therefore it > seems that the warning message points to the actual problem. > Unfortunately, I'm not skilled to go beyond this and really do not > know what

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Julian Zeidler
Hi Agustin, I had a similar problem with updating to a newer gdal Version. Rgdal was still linked to the old one. The problem disappeared after removing and reinstalling rgdal. If the above does not solve your issue have a look at your version of libtiff and try to update it. Best, Julian

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Agustin Lobo
More details: the problem occurs with tif files only, therefore it seems that the warning message points to the actual problem. Unfortunately, I'm not skilled to go beyond this and really do not know what to do. > GDALinfo("/media/Iomega_HDD/UAVetal/CALIBRACIONRADIOM/TETRACAM6/FISIOV_UB/ALGERRI/il

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/12/11 10:29, Agustin Lobo wrote: > Also, after reinstalling rgdal from cran, I get a warning: >> GDALinfo(paste(datawd,"/SPOTmultispectral/SP2003ATC_atm2.tif",sep=3D"")) > >> Error in .local(.Object, ...) : > WARNING ! libtiff version mismatch :

Re: [R-sig-Geo] Problem reading files through rgdal

2011-12-13 Thread Agustin Lobo
Just adding more details: gdalinfo works fine on the same file for which infoGDAL() fails: Also, after reinstalling rgdal from cran, I get a warning: > GDALinfo(paste(datawd,"/SPOTmultispectral/SP2003ATC_atm2.tif",sep="")) Error in .local(.Object, ...) : WARNING ! libtiff version mismatch : You'