Skip to content

R Raster to ArcGIS

4 messages · Matt.Farnsworth at aphis.usda.gov, Ashton Shortridge, Guy Serbin +1 more

#
Hi Matt (and list),

ArcGIS still (as far as I know) doesn't work with rectangular cells. This 
isn't a problem with the AsciitoGrid function, but I think is more 
fundamentally a problem with Arc's raster data structure.

The trick to getting around this may be to convert your matrix to a point 
object - with x, y, and z values - in R, where x and y correspond to the 
ground coordinates of each cell in the matrix. I think you would have to do 
this with your own code, but if you've programmed with arrays before it would 
not be difficult. Then interpolate these points to a square grid. The 
interpolation could be done in R (using gstat routines for example) or within 
a GIS (that is, write the xyz object to a text file, or perhaps straight to a 
shapefile, import it as a vector point set to a GIS, and then convert that to 
a raster.

Hope this helps,

Ashton
On Tuesday 29 July 2008, Matt.Farnsworth at aphis.usda.gov wrote:

  
    
#
Hi list,

I'm going to borrow what I just learned from my other thread.  I'd
export your raster data as an ENVI file, which ArcGIS should be able
to read with the ENVI Reader for ArcGIS installed.

1. Go to www.ittvis.com and download the appropriate version of the
ENVI Reader for ArcGIS (1.1 for ArcGIS 8.3-9.1, 1.2 for ArcGIS 9.2).
You won't need the ENVI reader for ArcGIS 9.3 as support for this
format is in the upcoming version.
2. Get the caTools package for R and load it.
3. Export your data from R using write.ENVI
4. Read data into ArcGIS using usual means.

You could also see if one of the other packages, e.g., RPyGeo, allows
you to directly interface between R and ArcGIS for your purposes.

Best of luck,
Guy Serbin
On Tue, Jul 29, 2008 at 2:54 PM, Ashton Shortridge <ashton at msu.edu> wrote:

  
    
#
On Tue, 29 Jul 2008, Guy Serbin wrote:

            
Seems like a long way round when readGDAL/writeGDAL in the rgdal package 
have plenty of drivers, such as GeoTiff. Depending on which application 
needs to be "in front", using rgdal and system() from R is very flexible.

I've found GDAL-generated GeoTiff files very easy to read into ENVI, 
harder to read into ArcGIS (may need statistics setting to get the 
symbology reasonable).

Roger