<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trying to Write a Script Using Weighted Overlay Having Issues in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/trying-to-write-a-script-using-weighted-overlay/m-p/1159898#M53497</link>
    <description>&lt;P&gt;I am trying to develop an independent tool using python and ArcGIS Pro SDK. I have everything working except for the weighted overlay. When I run the weighted overlay within Pro as a tool/within the model builder it runs just fine. However, when I export it to python to be added to by code I get the error:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Traceback (most recent call last):
  File "&amp;lt;string&amp;gt;", line 87, in execute
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 10159, in WeightedOverlay
    in_weighted_overlay_table)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Utils.py", line 55, in swapper
    result = wrapper(*args, **kwargs)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 10092, in Wrapper
    m = table_eval_pattern.match(in_weighted_overlay_table)
TypeError: expected string or bytes-like object&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the python export from the model builder:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay_Raster = "L:\\Projects\\14000\\14002\\GIS_Data\\gdb\\Deicing_Module_Builder.gdb\\Weighted_Overlay_Raster"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay = Weighted_Overlay_Raster&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;with arcpy.EnvManager(cellSize=Cell_Size, extent=Plow_Routes_Buffer, outputCoordinateSystem=Output_Coordinate_System, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;parallelProcessingFactor=Parallel_Processing_Factor, workspace=Workspace):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay_Raster = arcpy.sa.WeightedOverlay(in_weighted_overlay_table=[[NLCD_Recalc, 0.1, "NLCD_Land", "Developed 6;Agriculture 1;Forest 2;Herbaceuous 3;'Barren Land' 5;Shrub/Scrub 6", "NLCD Recalc"], [Soils_Raster, 0.15, "muaggatt_drclassdcd", "'Well drained' 3;'Excessively drained' 1;'Moderately well drained' 4;'Poorly drained' 6;'Somewhat excessively drained' 2;'Very poorly drained' 7;'Somewhat poorly drained' 5", "Soils_Raster"], [Wellhead_Raster, 0.35, "whp_type_NAME", "'Aquifer Delineation' 1;'Conjunctive Delineation' 1", "Wellhead_Raster"], [NWI_NHD_Reclass_raster, 0.4, "Value", "1 1", "NWI/NHD Reclass raster"]])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay_Raster.save(Weighted_Overlay)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me why I keep getting this message and why it only seems to happen when running in python? My goal is to have the weighted overlay run just like it does in Pro -- it prompts the user with a table and then produces a output raster. The only difference is that in my tool a ribbon button will bring up the table in a window.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2022 14:53:36 GMT</pubDate>
    <dc:creator>MaxwellDeBellaSRF</dc:creator>
    <dc:date>2022-03-31T14:53:36Z</dc:date>
    <item>
      <title>Trying to Write a Script Using Weighted Overlay Having Issues</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/trying-to-write-a-script-using-weighted-overlay/m-p/1159898#M53497</link>
      <description>&lt;P&gt;I am trying to develop an independent tool using python and ArcGIS Pro SDK. I have everything working except for the weighted overlay. When I run the weighted overlay within Pro as a tool/within the model builder it runs just fine. However, when I export it to python to be added to by code I get the error:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Traceback (most recent call last):
  File "&amp;lt;string&amp;gt;", line 87, in execute
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 10159, in WeightedOverlay
    in_weighted_overlay_table)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Utils.py", line 55, in swapper
    result = wrapper(*args, **kwargs)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 10092, in Wrapper
    m = table_eval_pattern.match(in_weighted_overlay_table)
TypeError: expected string or bytes-like object&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the python export from the model builder:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay_Raster = "L:\\Projects\\14000\\14002\\GIS_Data\\gdb\\Deicing_Module_Builder.gdb\\Weighted_Overlay_Raster"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay = Weighted_Overlay_Raster&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;with arcpy.EnvManager(cellSize=Cell_Size, extent=Plow_Routes_Buffer, outputCoordinateSystem=Output_Coordinate_System, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;parallelProcessingFactor=Parallel_Processing_Factor, workspace=Workspace):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay_Raster = arcpy.sa.WeightedOverlay(in_weighted_overlay_table=[[NLCD_Recalc, 0.1, "NLCD_Land", "Developed 6;Agriculture 1;Forest 2;Herbaceuous 3;'Barren Land' 5;Shrub/Scrub 6", "NLCD Recalc"], [Soils_Raster, 0.15, "muaggatt_drclassdcd", "'Well drained' 3;'Excessively drained' 1;'Moderately well drained' 4;'Poorly drained' 6;'Somewhat excessively drained' 2;'Very poorly drained' 7;'Somewhat poorly drained' 5", "Soils_Raster"], [Wellhead_Raster, 0.35, "whp_type_NAME", "'Aquifer Delineation' 1;'Conjunctive Delineation' 1", "Wellhead_Raster"], [NWI_NHD_Reclass_raster, 0.4, "Value", "1 1", "NWI/NHD Reclass raster"]])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;Weighted_Overlay_Raster.save(Weighted_Overlay)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me why I keep getting this message and why it only seems to happen when running in python? My goal is to have the weighted overlay run just like it does in Pro -- it prompts the user with a table and then produces a output raster. The only difference is that in my tool a ribbon button will bring up the table in a window.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 14:53:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/trying-to-write-a-script-using-weighted-overlay/m-p/1159898#M53497</guid>
      <dc:creator>MaxwellDeBellaSRF</dc:creator>
      <dc:date>2022-03-31T14:53:36Z</dc:date>
    </item>
  </channel>
</rss>

