I’m really new to Python and I would like to know whether there is a quick method to get cell values of a raster pixel by pixel and the coordinates (map X Y coordinate of centre of each pixel) using Python in ArcGIS 10? To describe this further, I need to get the map X, map Y and cell value of the first pixel and assign those three values in to three variables and repeat this step for rest of the other pixels (loop through the entire raster). Thanks.
I think I need to describe my question more. Problem is, I need to get the X Y location of a pixel of the first raster and get cell values of several other rasters corresponding to that X Y location. This process should be loop through every pixel of the first raster without creating any intermediate point shapefile as it is going to be really really time consuming since I have to handle a raster with nearly 8 billion pixels. Also, I need to do this usin Python in ArcGIS 10.
@JamesS: Thank you very much for your suggestion. Yes this would work for one raster but I need to collect the cell values for several other rasters as well. The problem is, after getting the X and Y coordinate of the first pixel of the first raster, I need to get the cell value of the second raster corresponding to that X, Y location of the first raster, then third raster and so on. So, I think when looping through the first raster, getting X and Y location of a pixel and getting cell values of the other raster corresponding to that location should be done simultaneously but I’m not sure. This can be done by converting the first raster in to a point shapefile and performing Extract multivalues to point function in ArcGIS 10 but I’m unable to follow that method because I don’t want to create a shapfile as it is going to be really slow and I HAVE TO FIND A SOLUTION USING PYTHON, not with any existing tool in ArcGIS.
@hmfly: Thanks, Yes this method (RastertoNumpyarray) will work if I can get the coordinate of a known row and column value of the array.
@whuber: I don’t want to perform any calculations, all I need to do is write X Y coordinates and cell values in to a text file and that’s all