Re: [R-sig-Geo] R-sig-Geo Digest, Vol 138, Issue 4

2015-02-06 Thread Karloz
r-sig-geo-requ...@r-project.org wrote: >Send R-sig-Geo mailing list submissions to > r-sig-geo@r-project.org > >To subscribe or unsubscribe via the World Wide Web, visit > https://stat.ethz.ch/mailman/listinfo/r-sig-geo >or, via email, send a message with subject or body 'help' to >

Re: [R-sig-Geo] Applying a simple math on a big stack takes a long time. How to improve it?

2015-02-06 Thread Michael Sumner
On Sat, 7 Feb 2015 10:17 Thiago V. dos Santos wrote: > Ops, by bad, I missed one value when writing the simplified script to the > list. The correct vector should be: > > rad.add.fact <- c(-64.2618, -65.8048, -60.6386, > -51.1339, -31.2914, -28.2876) > > > Thanks for pointing that out. > > This

Re: [R-sig-Geo] Applying a simple math on a big stack takes a long time. How to improve it?

2015-02-06 Thread Thiago V. dos Santos
Ops, by bad, I missed one value when writing the simplified script to the list. The correct vector should be: rad.add.fact <- c(-64.2618, -65.8048, -60.6386, -51.1339, -31.2914, -28.2876) Thanks for pointing that out. This vanishes the warning message but apparently doesn't affect the calcu

Re: [R-sig-Geo] Applying a simple math on a big stack takes a long time. How to improve it?

2015-02-06 Thread Baldwin, Jim -FS
rad.mult.fact has length 6 and rad.add.fact has length 5. Does that affect the calculations? Jim -Original Message- From: R-sig-Geo [mailto:r-sig-geo-boun...@r-project.org] On Behalf Of Thiago V. dos Santos Sent: Friday, February 06, 2015 2:07 PM To: R-SIG list Subject: [R-sig-Geo] Ap

[R-sig-Geo] Applying a simple math on a big stack takes a long time. How to improve it?

2015-02-06 Thread Thiago V. dos Santos
Hi all, I am processing some GeoTiff rasters with 60 files in total (might be more), which are relatively big: resolution is about 7800 x 7700 at 30m res and total file size is around 120MB (Landsat 8 images). I am trying to do a simple math equation calculation (please see the end of the code)

Re: [R-sig-Geo] stack many files without loading into memory

2015-02-06 Thread dschneiderch
Ok - Looks like it worked this time for 112 files from 2012. The netcdf is 2.25 GB while the compressed multiband geotiff is 510MB. Does the netcdf have so much overhead- the 112 file at 10MB each are only 1.12 GB individually? I like the tidiness of 1 file per year so I'll have to play with how e

Re: [R-sig-Geo] How to apply this function on each raster stack layer?

2015-02-06 Thread Thiago V. dos Santos
Frede and Loic, Thanks a lot for your feedback. I just realized that a simple multiplication  s1 <- (s * mult) + add not only works but is much faster than the function I wrote. Raster is a really well-implemented package. Greetings, -- Thiago V. dos Santos PhD student Land and Atmospheric Science

Re: [R-sig-Geo] gDistance problem on RHEL 6 64-bit

2015-02-06 Thread Hollister, Jeff
Roger (and List), I think I am giving up on this one. make check failed with: lt-XMLTester: ../../../source/headers/geos/geom/GeometryFilter.h:61: virtual void geos::geom::GeometryFilter::filter_ro(const geos::geom::Geometry*): Assertion `0' failed. ./testrunner: line 1: 2094 Aborted

Re: [R-sig-Geo] stack many files without loading into memory

2015-02-06 Thread dschneiderch
Hi Michael - Yes saving as GTiff with the compression options reduced the file size from ~10MB to ~2.5M for a single file but I am having a lot of trouble getting it to save the whole stack. I'm definitely running out of memory on my computer so maybe R is being slow and timing out? I've left it ov

Re: [R-sig-Geo] writeRaster does not preserve names when writing to NetCDF

2015-02-06 Thread dschneiderch
I was running into this problem and wondering if there was any progress? As a workaround, I was trying to add an attribute to my variable using ncput_att but it doesn't show more than 1 (no warning was shown that only 1 could be accepted and the min/max attributes have a value for each layer). r=r

Re: [R-sig-Geo] gDistance problem on RHEL 6 64-bit

2015-02-06 Thread Hollister, Jeff
Roger, Thanks again for your help on this. It is appreciated! I'll work on getting everything removed and start from what is hopefully a clean install of GEOS and rgeos and go from there. Will let the list know what I find out. Also, byid=T bombs out the same. Cheers, Jeff -Original

Re: [R-sig-Geo] gDistance problem on RHEL 6 64-bit

2015-02-06 Thread Roger Bivand
On Thu, 5 Feb 2015, Hollister, Jeff wrote: Roger, Thanks for getting back to me. I thought it was a GEOS problem too. I have updated it and re-installed rgeos. Curret GEOS is: version_GEOS() [1] "3.4.2-CAPI-1.8.2 r3921" I tried several of the other rgeos examples (gBuffer, gWithin, gEn

Re: [R-sig-Geo] How to apply this function on each raster stack layer?

2015-02-06 Thread Dutrieux, Loic
Hi Thiago, The approach you took seems correct. See example below. library(raster) fn <- system.file("external/test.grd", package="raster") s <- stack(fn, fn) # And these are sample coefficients: mult <- c(0.0003342, 0.0005534) add <- c(0.1, 0.2) # define calc function fun <- function(x) {