[R-sig-Geo] Reading jpeg and tiff

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Fri Apr 27 10:28:30 CEST 2007


Dear useRs,

I'm trying to read jpeg and GeoTiff with readGDAL() (rgdal package). The
jpeg is about 5.6 MB in size, has 3063 rows and 4870 columns and has 3
bands. The tiff is 3.7 MB, has 15750 rows and 12600 colums and 1 band. I
can't import neither of them in R due to a lack of memory. Although I've
set the memory limit to the max (memory.limit(size =
round(memory.limit()/1048576.0, 2))). I'm running R 2.4.1 on a Win Xp
machine with 2 GB RAM.

So far I managed to read in the data but a lower resolution, which I
don't want. Any suggestions on a more efficient way to import these
files. Solutions based on Spatial-classes are prefered.

Here is the code I'm using now.

library(rgdal)
memory.limit(size = round(memory.limit()/1048576.0, 2))
info <- GDALinfo("d://ferraris0894.jpg")
readGDAL("d://ferraris0894.jpg", output.dim = round(c(info[["rows"]],
info[["columns"]]) / 2))


sessionInfo()
R version 2.4.1 (2006-12-18) 
i386-pc-mingw32 

locale:
LC_COLLATE=Dutch_Belgium.1252;LC_CTYPE=Dutch_Belgium.1252;LC_MONETARY=Du
tch_Belgium.1252;LC_NUMERIC=C;LC_TIME=Dutch_Belgium.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "tcltk"

[7] "methods"   "base"     

other attached packages:
   rgdal       sp     svIO   R2HTML   svMisc svSocket    svIDE 
 "0.5-8" "0.9-13"  "0.9-5"   "1.58"  "0.9-5"  "0.9-5"  "0.9-5"


Thanks,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney




More information about the R-sig-Geo mailing list