Raster into ASCII

664
2
09-06-2010 06:11 AM
TaiseerHarb
New Contributor
Hello helpers,

I have a dem-raster, and I have no problem in converting it into ASCII file.
However, the result ASCII has 583 columns and 472 raws which is not suitable my specific further applications.
The resulted ASCII file should have 640 columns and 512 rows.
How can I extract (by mask or any other way) a sub domain of the original dem-raster with known columns and rows numbers.

Thanks
0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus
you have to expand your extent in the "environments" tab for whatever tool you are using in arctoolbox.  If you know your current extent in real world coordinates, then it should be fairly straightforward to increase (or decrease) it since you also have the cell size.  ie right-left in coordinates divided by cell size gives you the number of columns, top-bottom/cell size the number of rows... to alter rearrange the identity
0 Kudos
MatejTacer
New Contributor III
Not sure that this is what you were up to, but I've read images (rasters) into arrays using Python and NumPy (completely outside GIS). I'm not sure if you are familiar with scripting, however, this worked perfectly for me:

import Image
from numpy import *
im =Image.open(imPathFile)
pix = array(im).transpose()

where pix is matrix with numeric values; matrix dimension is the same as the dimension of the raster and value locations are the same as in the pixel locations in the image.

Cheers,
0 Kudos