[R-sig-Geo] trouble importing a .img file from ArcMap 10

Ashton Shortridge ashton at msu.edu
Tue May 1 02:09:42 CEST 2012


Hi Megan,

I'm not an expert on img files, but as a workaround could you simply load the 
image into ArcMap and then export it as a geotiff? That's the format I 
generally use.

You can also do these format conversions using the GDAL command line 
utilities, and via the GDAL plugin in Quantum GIS.


On Tuesday, May 01, 2012 07:21:23 AM Megan Marcotte wrote:
> Hello,
> 
> This is a rather low level question but I'd appreciate your help. I have
> given a colleague .img files from ArcMap 10 to import into R. I don't know
> R and she is new to ArcMap files and we are having trouble getting the
> files in. I was hoping some of you could set us straight on what we are
> doing wrong.
> 
> When I look in ArcMap the file works well and contains data. There are 5
> source files for the raster in ArcMap but only the .img, .img.vat.dbf, and
> .rrd files were attachable by email (so I did not send a disc image file or
> a lock file).
> 
> My colleague has install RGDAL and GDAL (and other packages) and tried
> importing using functions raster and readGDAL to import the .img file, but
> 
> gets the following errors:
> > Elev <- raster("file_name.img")
> 
> Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",
> 
>   Cannot create a RasterLayer object from this file.
> 
> > Elev <- readGDAL("file_name.img")
> 
> Error in .local(.Object, ...) :
>   Unable to open file_name.img, it has zero usable bands.
> 
> (http://science.nature.nps.gov/im/monitor/stats/R/Data_io.cfm provided
> instructions)
> 
> We would like to get the file successfully imported and have R know that
> the coordinates are in WGS84. Can anyone please advise us on how to
> accomplish this?
> 
> The file is in .img format  because I converted the coordinate system in
> ArcMap. If importing it in its native coordinate system and then converting
> to WGS84 in R is easier than I would gratefully accept help on that
> instead.
> 
> Thanks so much!
> Megan
> 
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/trouble-importing-a-img-file-from-A
> rcMap-10-tp7515387.html Sent from the R-sig-geo mailing list archive at
> Nabble.com.
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 

Ashton Shortridge
Associate Professor
Dept. of Geography
Michigan State University
http://www.msu.edu/~ashton



More information about the R-sig-Geo mailing list