Hi,
What is the latest on internal $$RowMap etc grids in ArcGIS 10? One has to go the numpy route?
Hi,
What is the latest on internal $$RowMap etc grids in ArcGIS 10? One has to go the numpy route?
Unfortunately, that seems to be the only solution for now. You might want to add your voice to the ArcGIS "wish list" at ideas.arcgis.com. An arc grid request has already been created. Click here for a direct link.One has to go the numpy route?
Thanks for the link - I have voted it up!

It sounds like we have taken a step backwards to the 1990's and Spatial Analyst 1.0. The best workaround I found in that environment was to compute flow accumulations for constant direction grids (and unit weights): $$ColMap is the flow accumulation of a grid filled with 1's and $$RowMap is the flow accumulation of a grid filled with 4's. (To be precise, you may have to add 1 to each result if you want to reproduce these internal grids exactly, but that's rarely necessary: formulas tend to be more convenient when indexes begin with 0 instead of 1.)
http://webhelp.esri.com/arcgiSDEskto...w_accumulation
$$XMap and $$YMap can be computed from $$ColMap and $$RowMap in terms of the grid's origin and cellsize, as usual.
--Bill Huber
Quantitative Decisions
For more help, visit the worldwide community at http://gis.stackexchange.com

From this thread, in version 10
http://forums.arcgis.com/threads/865...on-map-algebra
try the example
Code:import numpy as np import arcpy #source http://forums.arcgis.com/threads/865-quot-built-in-quot-rasters-in-python-map-algebra #with some fiddling # Setup some rasters of rows and columns # (like old $$ROWMAP and $$COLMAP) arcpy.env.workspace = "c:/temp" arcpy.env.overwriteOutput = 1 nprows = np.indices((10,10))[0] npcols = np.indices((10,10))[1] # Convert the numpy arrays to ESRI rasters (ie Raster objects) # called 'rows' and 'cols' row_ras = arcpy.NumPyArrayToRaster(nprows) row_ras.save("rowraster") col_ras = arcpy.NumPyArrayToRaster(npcols) col_ras.save("colraster") print row_ras print col_ras
Geomatics, Carleton University, Ottawa, Canada
I found I can use the built in GRID variables or scalars in ArcGIS 10 with a bit of a hack. It appears that the python arcgisscripting module is still included in Desktop ArcGIS 10, perhaps for backwards compatibility (or perhaps I didn't uninstall 9.3 properly...), so I wrote a little script that uses the SingleOutputMapAlgebra tool, created a script tool and added that to a custom toolbox and then just use that as required.
I've attached a screenshot.Code:import arcgisscripting gp = arcgisscripting.create(9.3) #This works in ArcGIS 10!!! expr=gp.getparameterastext(0) output=gp.getparameterastext(1) result=gp.SingleOutputMapAlgebra(expr,output)

I did an implementation of this idea in arcpy map algebra here:
$$NCOLS + $$ROWMAP?
Last edited by curtvprice; 05-12-2013 at 05:02 PM. Reason: fixed link!
Bookmarks