-1

I have an ASCII grid file that has rectangular cells. The ESRI documentation does not specify how to convert from .asc to raster with a DX/DY value such that:

NCOLS 1900
NROWS 1100
XLLCORNER 115.834717
YLLCORNER 31.638744
XCELLSIZE ...
YCELLSIZE ...
NODATA_VALUE 0

I do not want to read into a NumPy array. So how would one do this, be it manually, in ArcGIS?

2

I suggest three steps workflow; (1) Edit header, (2) Import the file, and (3) Georeference it to its proper extent.

(1) Edit the header (XLLCORNER, YLLCORNER, CELLSIZE) to a dummy extent

NCOLS 1900
NROWS 1100
XLLCORNER 0.0
YLLCORNER 0.0
CELLSIZE 1
NODATA_VALUE 0

(2) Read this file by Ascii to Raster

(3) Georeference it by Warp

Source

0 0
1900 0
0 1100
1900 1100

Target

115.834717 31.638744
115.834717 + XCELLSIZE * 1900 31.638744
115.834717 31.638744 + YCELLSIZE * 1100
115.834717 + XCELLSIZE * 1900 31.638744 + YCELLSIZE * 1100

Above calculation comes from:

xLR= XLLCORNER + XCELLSIZE * NCOLS
yUL= YLLCORNER + YCELLSIZE * NROWS
  • Effectively thats what I had to do but I just got the extent from the raster layer. In our original grid file, we already had the LL and UR values, so I just mapped to that; this however will allow for quicker calculations in ArcPy. So there is no way to use XCELLSIZE or YCELLSIZE inherently? – pstatix Jun 7 '17 at 1:43
  • Unfortunately not, as far as I know. – Kazuhito Jun 7 '17 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.