+ Reply to Thread
Results 1 to 7 of 7

Thread: internal grids rowmap/colmap/xmap/ymap

  1. #1
    Hugo Ahlenius
    Join Date
    May 2010
    Posts
    132
    Points
    10
    Answers Provided
    3


    0

    Default internal grids rowmap/colmap/xmap/ymap

    Hi,

    What is the latest on internal $$RowMap etc grids in ArcGIS 10? One has to go the numpy route?
    --------------------
    Hugo Ahlenius
    Nordpil - GIS consultants

  2. #2
    Manny Gimond
    Join Date
    May 2010
    Posts
    21
    Points
    0
    Answers Provided
    0


    0

    Default Re: internal grids rowmap/colmap/xmap/ymap

    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.

  3. #3
    Hugo Ahlenius
    Join Date
    May 2010
    Posts
    132
    Points
    10
    Answers Provided
    3


    0

    Default Re: internal grids rowmap/colmap/xmap/ymap

    Thanks for the link - I have voted it up!
    --------------------
    Hugo Ahlenius
    Nordpil - GIS consultants

  4. #4
    William Huber

    Join Date
    Apr 2010
    Posts
    694
    Points
    73
    Answers Provided
    2


    0

    Default Re: internal grids rowmap/colmap/xmap/ymap

    Quote Originally Posted by fraxinus View Post
    What is the latest on internal $$RowMap etc grids in ArcGIS 10? One has to go the numpy route?
    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

  5. #5
    Dan Patterson

    Join Date
    Apr 2010
    Posts
    1,755
    Points
    442
    Answers Provided
    41


    0

    Default Re: internal grids rowmap/colmap/xmap/ymap

    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
    http://obidangis.blogspot.ca/

  6. #6
    Luke Pinner
    Join Date
    May 2010
    Posts
    317
    Points
    284
    Answers Provided
    32


    0

    Default Re: internal grids rowmap/colmap/xmap/ymap

    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.

    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've attached a screenshot.
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	customSingleOutputMapAlgebra.png‎
Views:	301
Size:	39.5 KB
ID:	7046  

  7. #7
    Curtis Price

    Join Date
    Oct 2009
    Posts
    1,798
    Points
    874
    Answers Provided
    127


    0

    Default internal grids rowmap/colmap/xmap/ymap

    Quote Originally Posted by whuber View Post
    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.
    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!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts