Does anyone know if the following docell code can be done with map algebra in ArcGIS 10? docellif (flr_ezg eq 1) to_flg_lg = flg_lg_ezg(1,0)if (flr_ezg eq 2) to_flg_lg = flg_lg_ezg(1,1)if (flr_ezg eq 4) to_flg_lg = flg_lg_ezg(0,1)if (flr_ezg eq 😎 to_flg_lg = flg_lg_ezg(-1,1)if (flr_ezg eq 16) to_flg_lg = flg_lg_ezg(-1,0)if (flr_ezg eq 32) to_flg_lg = flg_lg_ezg(-1,-1)if (flr_ezg eq 64) to_flg_lg = flg_lg_ezg(0,-1)if (flr_ezg eq 128) to_flg_lg = flg_lg_ezg(1,-1)endI would like to code in arcobjects c# with map algebra. I have read about numpy array as one way to do it in python. Thanks for any helpBruce Vandenberg
>>> expr = "tmp3 = tmp1(0,1)" >>> r = arcpy.gp.MultiOutputMapAlgebra_sa(expr) >>> print arcpy.GetMessages(0) Executing: MultiOutputMapAlgebra "tmp3 = tmp1(1,1)" Start Time: Thu Aug 08 17:27:30 2013 Succeeded at Thu Aug 08 17:27:30 2013 (Elapsed Time: 0.00 seconds) >>> r = arcpy.gp.MultiOutputMapAlgebra_sa("print tmp3") 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN 1 1 1 1 1 1 1 1 1 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN >>>
expr = """ {2} = con( {0} eq 1, {1}(1,0), {0} eq 2, {1}(1,1), {0} eq 4, {1}(0,1), {0} eq 8, {1}(-1,1), {0} eq 16, {1}(-1,0), {0} eq 32, {1}(-1,-1), {0} eq 64, {1}(0,-1), {0} eq 128, {1}(1,-1)) """.format("flr_ezg","flg_lg_ezg","to_flg_lg") arcpy.gp.MultiOutputMapAlgebra(expr.replace("\n",""))
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.