Sunday, 30 January 2011

Converting raster dataset to XYZ in ARCGIS !!

It is most probable that you might have to convert from XYZ data to raster image and vice versa because there are applications which can only read XYZ data for visualizing and analyzing. In my case, I always use MATLAB for such case where I can process numbers of images in a loop. One of reader send me an email asking to show a way to do such tasks in ArcGIS. So, here I will show how to convert raster dataset to XYZ. Of course, the way I show can be executed for numbers of images by using python. If someone interested in that, shoot me an email. I will duly oblige.

1) Open your raster image in  ArcMap.
2) Open the Sample tool from ArcToolbox>Spatial Analyst Tools >Extraction.
3) Select the raster dataset as the Input Raster and select the raster dataset again in the 'Input location raster or point feature'. Choose ' Resampling technique' is set to Nearest.
4) Specifiy an output table.
5) The output table is in the format: Object ID, Z, X, Y and Z. The sample file would look like in the following figure.

6) Open the table. Right click a field that you are not interested in and choose 'Turn Field Off'. Do this of for all of fields that is not of interest.
7) Right click the table and  choose Data >Export and give an appropriate name and you are done.