Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Anthony Fischbach
Thank you Robert, I amended my previous post to correct the duplicate use of the x variable and to provide an intuitive black to white color ramp for the ice. - Tony Fischbach, Wildlife Biologist Walrus Research Program Alaska Science Center U.S. Geological Survey 4210 University Drive Anchora

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Robert J. Hijmans
Tony, On Wed, Oct 19, 2011 at 1:13 PM, Anthony Fischbach wrote: > This works beautifully. > Is there a trick to applying an intuitive color ramp to the png file You can provide a list of colors such as that generated by rainbow , heat.colors

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Thomas . Adams
Tony, I certainly don't want to belabor the point, but GRASS GIS with R is fully scriptable (shell, Perl, whatever); I have done this with many projects. GRASS shell scripts are far easier to write in my experience than ArcGIS. Several of my scripts are completely automated and run off of cron

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Anthony Fischbach
This works beautifully. Is there a trick to applying an intuitive color ramp to the png file and setting the non-ice to null values? I have tried to assign all non ice and ice = 0 values to NA. This works down to the level of the extract function. ... fileName <- 'ftp://sidads.colorado.edu/pub/DA

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Robert J. Hijmans
Anthony, projectRaster failed because it uses projectExtent, which fails to give the right answer for a circumpolar dataset. I used projectExtent to make projectRaster more efficient. I took it out and now things work as expected on these data (and perhaps a bit slower in some other cases). Fixed

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Robert J. Hijmans
Not sure what's going on here, I need to investigate. But this work-around, which replicates the essence of projectRaster works for me: library(rgdal) x <- raster(ymn=60) res(x) <- 0.25 xy <- coordinates(x, sp=T) xypole <- spTransform(xy, projection(r, asText=F)) x[] <- extract(r, xypole, method=

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Roger Bivand
On Wed, 19 Oct 2011, Anthony Fischbach wrote: Thank you for the GRASS suggestion. It would also be straight forward in ArgGIS, but I seek to run this all in a scripting environment with the full flexibility of R such that I may automate the whole process. I have a feeling that this is strandin

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Anthony Fischbach
Thank you for the GRASS suggestion. It would also be straight forward in ArgGIS, but I seek to run this all in a scripting environment with the full flexibility of R such that I may automate the whole process. Following on the projectRaster idea, I have tried using the from and to options, first c

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Thomas Adams
Tony, This would be a far easier task in, say, GRASS GIS — once the data is there, R integrates very nicely with GRASS, making the combination quite powerful. Tom On 10/19/11 1:36 PM, Anthony Fischbach wrote: Very elegant! But the projection seems to have trouble. Please see images of the

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Anthony Fischbach
Very elegant! But the projection seems to have trouble. Please see images of the original raster and the projected raster produced with plot commands. http://r-sig-geo.2731867.n2.nabble.com/file/n6909694/rr.png http://r-sig-geo.2731867.n2.nabble.com/file/n6909694/rgeo.png - Tony Fischbach,

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Robert J. Hijmans
Here is one approach: rgeo <- projectRaster(rr, crs="+proj=longlat +datum=WGS84") KML(rgeo, "file.kml") Best, Robert On Wed, Oct 19, 2011 at 10:00 AM, Anthony Fischbach wrote: > In my previous post I happily handled the binary National Snow and Ice Data > Center sea ice imagery and cast it int

Re: [R-sig-Geo] Reading National Snow and Ice Data Center binary files

2011-10-19 Thread Anthony Fischbach
In my previous post I happily handled the binary National Snow and Ice Data Center sea ice imagery and cast it into a GeoTiff. My next challenge is to wrap the GeoTiff into a kml overlay. Continuing the code from the previous post, I pick it up just after writing the raster object to the geoTiff.

Re: [R-sig-Geo] [rgeos] A gIntersection operation causes RStudio to crash

2011-10-19 Thread Mathieu Rajerison
Hi, Thanks for the help of Roger Bivand that previously gave me a method on how to conveniently compute intersections between objets using rgeos and the help of Colin Rundel, all works fine. - For those who are interested, here is the result of fractal dimension index calculation: http://hpics.li

Re: [R-sig-Geo] Counting points within polygons

2011-10-19 Thread Agustin Lobo
well, what I sent is actually the same than you had written at the end of your message, I went too fast and thought it was the example of the help page of overlay. Sorry for the noise Agus 2011/10/19 Agustin Lobo : > You are right the vignette is pretty clear. > I think this is a more elegant solu

Re: [R-sig-Geo] Counting points within polygons

2011-10-19 Thread Agustin Lobo
You are right the vignette is pretty clear. I think this is a more elegant solution (BorneoLC is the Sp Pol DF and fireLC2 the Sp Points DF): > delme6 <- over(BorneoLC, fireLC2, returnList = TRUE) > nbp <- sapply(delme6,nrow) > newdata <- data.frame(BorneoLC@data,nbp=nbp) > BorneoLC2 <- BorneoLC >