[R-sig-Geo] trouble importing a .img file from ArcMap 10
Megan Marcotte
megotte at gmail.com
Tue May 1 01:21:23 CEST 2012
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-ArcMap-10-tp7515387.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list