[R-sig-Geo] importing adf file to R using RArcInfo / converting adf file to R friendly format

Virgilio Gomez-Rubio v.gomezrubio at imperial.ac.uk
Wed Sep 3 00:19:00 CEST 2008


Harry,

I have been able to reproduce your error and it seems that the problem
is that there is not enough memory to load your data. Furthermore, I am
not sure whether RArcInfo can handle this sort of gridded data. I
believe that your data is an Arc/Info Binary Grid, which can be read
with package rgdal:

library(rgdal)
dpath<-"/home/vrubio/tmp/GLiPHAmaps/global/poultry/totcor/glbpod1t0503m/hdr.adf"
x <- new("GDALReadOnlyDataset", dpath)
getDriver(x)
getDriverLongName(getDriver(x))

library(RColorBrewer)
xx<-asSGDF_GROD(x, output.dim=c(200, 200))
spplot(xx, "band1", 
   at=c(0, 10, 50, 100, 200, 500, 1000, 2500, max(xx$band1,
na.rm=TRUE)),
   col.regions=brewer.pal(8,"Oranges") )

If you require a higher resolution try to increase the values of
output.dim=c(200, 200) but be careful because it can take a lot of
memory.

Hope this helps,

Virgilio

On Tue, 2008-09-02 at 12:35 -0700, Harry Kim wrote:
> Dear R-sig-geoers
> 
>      I need some help on importing adf file--ArcGIS coverage file
> which is no longer supported--into R and was hoping if I could get any
> input from you. I've searched the forum and came across a package
> named "RArcInfo".
> It has functions to read and plot the ArcGIS coverage files in R.
>      I obtained the data from
> http://www.fao.org/geonetwork/srv/en/metadata.show?id=12720
> 
>     The direct link to the data set is
> http://www.fao.org/geonetwork/srv/en/resources.get?id=12720&fname=glbpototcor.zip&access=private
> 
>      and this is what it is supposed to look like
> http://www.fao.org/geonetwork/srv/en/resources.get?access=public&id=12720&fname=glbpod1t0503m.gif
> 
> Here is what I did so far:
> 
> #set the path
> datadir=getwd()
> coveragedir= "C:/Users/Harry/Desktop/poultry/glbpod1t0503m/"
> infodir= "C:/Users/Harry/Desktop/poultry/info/"
> 
> #obtain table and coverage names
> tablenames<-get.tablenames(infodir)
> covnames<-get.namesofcoverages(datadir)
> 
> arc=get.arcdata(datadir, covnames, filename="w001001x.adf")
> 
>    The arc file is read into R and I can even plot it but when I try
> the file that I am actually interested in analyzing (w001001.adf), R
> crashes. I am assuming that the size of the file (100 mb) is too much
> to handle and it breaks.
> 
> So I would like to see if it is possible to convert this ArcGIS
> coverage file into more managable format in R. Are there any suitable
> options? My final aim is to get the density values associated with the
> coordinates in the world.  I am aware that I can convert the coverage
> file to E00 format but I've searched on the internet how I can use
> this in R, and so far had no luck finding much of valuable
> information.
> 
> Thank you so much
> Harry
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo




More information about the R-sig-Geo mailing list