Adventures in Data Interoperability
December 14, 2008 4:20 PM Subscribe
How do I convert a large raster image into a table for analysis and manipulation?
I have a bunch of raster-format GIS data (e.g. DEMs, satellite imagery) which I would like to perform a regression analysis on (among other things) in a statistics package. I have often started with a table, performed my analysis, tacked some parameters onto the top of the table, and had ArcGIS treat the table as a raster. This time, I'm starting with a raster, and I want to convince my stats package that it's a table. (If it helps, image formats available include .bmp, .jpg, .jp2, .img, .png, .tif, and ESRI GRID.)
So, briefly: help me convert a raster into a table, where every entry in the table represents one cell of the raster. (I am aware that this will be a very large table.)
I have a bunch of raster-format GIS data (e.g. DEMs, satellite imagery) which I would like to perform a regression analysis on (among other things) in a statistics package. I have often started with a table, performed my analysis, tacked some parameters onto the top of the table, and had ArcGIS treat the table as a raster. This time, I'm starting with a raster, and I want to convince my stats package that it's a table. (If it helps, image formats available include .bmp, .jpg, .jp2, .img, .png, .tif, and ESRI GRID.)
So, briefly: help me convert a raster into a table, where every entry in the table represents one cell of the raster. (I am aware that this will be a very large table.)
I remember doing this with Idrisi (Kiliminjaro - the new version is called Andes).
posted by desjardins at 5:22 PM on December 14, 2008
posted by desjardins at 5:22 PM on December 14, 2008
Best answer: You can export from ArcMap into ASCII using the Conversion tools. The ASCII format is just a plain text document with header info (e.g. geographic information, cell size, etc.), and then all the cell values in rows and columns.
posted by one_bean at 5:37 PM on December 14, 2008
posted by one_bean at 5:37 PM on December 14, 2008
I don't have the software in front of me, but if you use ArcGIS to export/convert from an image format (or a selection of features) to a shapefile, you'll get a .dbf table as one of the components of the shapefile.
Google also returns freeware options using search terms such as "arcgis convert DEM to shapefile".
posted by McGuillicuddy at 6:19 PM on December 14, 2008
Google also returns freeware options using search terms such as "arcgis convert DEM to shapefile".
posted by McGuillicuddy at 6:19 PM on December 14, 2008
If you go with McGuillicuddy's route, make sure to export to a point shapefile rather than a polygon. Converting to polygon dissolves neighboring cells with the same value into a single polygon, whereas exporting to point will preserve every individual cell.
posted by one_bean at 6:24 PM on December 14, 2008
posted by one_bean at 6:24 PM on December 14, 2008
There's probably a way to do this in R, also. spatialR is a pretty good website on such things.
posted by one_bean at 6:43 PM on December 14, 2008
posted by one_bean at 6:43 PM on December 14, 2008
are you talking about taking a plot of data and extracting the table that the graph is based on? Like this?
posted by soundslikeobiwan at 8:46 PM on December 14, 2008 [1 favorite]
posted by soundslikeobiwan at 8:46 PM on December 14, 2008 [1 favorite]
Best answer: Imagemagick delivers the goods as usual:
posted by ghost of a past number at 11:27 PM on December 14, 2008 [1 favorite]
convert foo.png BIGASS_TABLE.txt
posted by ghost of a past number at 11:27 PM on December 14, 2008 [1 favorite]
This thread is closed to new comments.
posted by paanta at 4:39 PM on December 14, 2008