Re: [R-sig-Geo] Gradient calculation with ESRI grid (.asc) format

2009-05-05 Thread Robert Hijmans
You could try the focalFilter function in the raster package: install.packages("raster", repos="http://R-Forge.R-project.org";) with this argument for the Sobel filter: filter=matrix(c(1,2,1,0,0,0,-1,-2,-1) / 4, nrow=3) (For using raster this way you should upgrade to R 2.9 first, if you have not

[R-sig-Geo] Gradient calculation with ESRI grid (.asc) format

2009-05-05 Thread Tim Sippel
I'm looking to calculate gradients from oceanographic variables (ie. sea surface temperature, chlorophyll, etc.) for which I have downloaded in ESRI grid format (.asc). From some research on gradient analysis, I have found a few people who have used a Sobel filter to estimate gradients in images (

Re: [R-sig-Geo] readRAST6: too many open files

2009-05-05 Thread Roger Bivand
On Tue, 5 May 2009, Roger Bivand wrote: On Tue, 5 May 2009, Agustin Lobo wrote: Roger, After upgrading, the test works with plugin=F, while plugin=T produces the same result. I find this too on Fedora 10, plugin=TRUE fails after a hundred or so calls, and then crashes R on a further comma

Re: [R-sig-Geo] readRAST6: too many open files

2009-05-05 Thread Roger Bivand
On Tue, 5 May 2009, Agustin Lobo wrote: Roger, After upgrading, the test works with plugin=F, while plugin=T produces the same result. I find this too on Fedora 10, plugin=TRUE fails after a hundred or so calls, and then crashes R on a further command. With plugin=FALSE, there is no proble

Re: [R-sig-Geo] readRAST6: too many open files

2009-05-05 Thread Agustin Lobo
Roger, After upgrading, the test works with plugin=F, while plugin=T produces the same result. Also, ignore.stderr=T yields: ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format. WARNING: Input raster map constains cells with NULL-value (no-data). The value

Re: [R-sig-Geo] unique spatial polygons

2009-05-05 Thread Roger Bivand
On Tue, 5 May 2009, Alina Sheyman wrote: and for some reason I am still getting the error that I have non-unique id's eventhough i had deduped both of my files. Any idea why this would be happening? Please refer to comments below: On Tue, May 5, 2009 at 10:16 AM, Alina Sheyman wrote: I'

Re: [R-sig-Geo] unique spatial polygons

2009-05-05 Thread Alina Sheyman
and for some reason I am still getting the error that I have non-unique id's eventhough i had deduped both of my files. Any idea why this would be happening? On Tue, May 5, 2009 at 10:16 AM, Alina Sheyman wrote: > > I'm still working on trying to combine two spatial files. > So far I've done the

Re: [R-sig-Geo] readRAST6: too many open files

2009-05-05 Thread Roger Bivand
On Tue, 5 May 2009, Agustin Lobo wrote: Here it is: R version 2.9.0 (2009-04-17) i486-pc-linux-gnu locale: LC_CTYPE=es_ES.UTF-8;LC_NUMERIC=C;LC_TIME=es_ES.UTF-8;LC_COLLATE=es_ES.UTF-8;LC_MONETARY=C;LC_MESSAGES=es_ES.UTF-8;LC_PAPER=es_ES.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMEN

Re: [R-sig-Geo] readRAST6: too many open files

2009-05-05 Thread Agustin Lobo
Here it is: R version 2.9.0 (2009-04-17) i486-pc-linux-gnu locale: LC_CTYPE=es_ES.UTF-8;LC_NUMERIC=C;LC_TIME=es_ES.UTF-8;LC_COLLATE=es_ES.UTF-8;LC_MONETARY=C;LC_MESSAGES=es_ES.UTF-8;LC_PAPER=es_ES.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=es_ES.UTF-8;LC_IDENTIFICATION=C attache

Re: [R-sig-Geo] unique spatial polygons

2009-05-05 Thread Alina Sheyman
I'm still working on trying to combine two spatial files. So far I've done the following zipmaps1a<- unionSpatialPolygons(zipmaps1,IDs=paste(zipmaps1$ZCTA)) zipmaps1_df<- as(zipmaps1, "data.frame") [!duplicated(zipmaps1$ZCTA), -(1:4)] row.names(zipmaps1_df)<- paste(zipmaps1_df$ZCTA) zipmaps1b <- S

Re: [R-sig-Geo] readRAST6: too many open files

2009-05-05 Thread Roger Bivand
On Tue, 5 May 2009, Agustin Lobo wrote: We're using rastdum <- readRAST6("nomdum",cat=F,ignore.stderr = T) (on a ubuntu 8.10 machine and R 2.9) within a for() loop of hundreds of iterations. At some point (ca. 199) we get an error "Too many open files" and suspect that this is because readRAS

[R-sig-Geo] readRAST6: too many open files

2009-05-05 Thread Agustin Lobo
We're using rastdum <- readRAST6("nomdum",cat=F,ignore.stderr = T) (on a ubuntu 8.10 machine and R 2.9) within a for() loop of hundreds of iterations. At some point (ca. 199) we get an error "Too many open files" and suspect that this is because readRAST6() is opening and not closing files. Is

Re: [R-sig-Geo] spplot: no boundary lines for polygons

2009-05-05 Thread Roger Bivand
On Tue, 5 May 2009, Agustin Lobo wrote: I have a complex shape file imported to R via rgdal as a SPolDF. I want to display continuous attributes with a color key but the black boundaries of the polygons, which are small in general, introduce "too much black" in the plot and the spatial variation

[R-sig-Geo] spplot: no boundary lines for polygons

2009-05-05 Thread Agustin Lobo
I have a complex shape file imported to R via rgdal as a SPolDF. I want to display continuous attributes with a color key but the black boundaries of the polygons, which are small in general, introduce "too much black" in the plot and the spatial variation of the attribute is not correctly display

[R-sig-Geo] index of eccentricity

2009-05-05 Thread David March MorlĂ 
Dear list, I would like to calculate an index of eccentricity (ECC) of an animal's home range (a polygon determined with adehabitat package and then exported as shapefile). ECC=l/w, where 'l' is the maximum lenght of the polygon, and 'w' is the maximum width of the polygon. Could you suggestm

Re: [R-sig-Geo] Large PDF files when using tiff raster images as background

2009-05-05 Thread Roger Bivand
On Mon, 4 May 2009, dominik baenninger wrote: Dear list, When plotting spatial informaion it is common to use a pixel map as background. Therefore I used the following commands (in brief) library(sp) library(rgdal) pdf() readGDAL(geotiff-file) image() plot(...,add=T) dev.off() This works f