<?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 Re: Python Toolbox can't match input parameter to dictionary key in dictionary.get() function in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-toolbox-can-t-match-input-parameter-to/m-p/1226478#M61675</link>
    <description>&lt;P&gt;Thanks, Graeme. I resolved it with the .strip() function in the for loop.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Oct 2022 01:25:49 GMT</pubDate>
    <dc:creator>elmort</dc:creator>
    <dc:date>2022-10-28T01:25:49Z</dc:date>
    <item>
      <title>Python Toolbox can't match input parameter to dictionary key in dictionary.get() function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-toolbox-can-t-match-input-parameter-to/m-p/1225494#M61556</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;I am writing a Python Toolbox for a parcel prioritization tool. My input data (a set of 11 rasters) is organized into a dictionary, raster_dict, where keys are raster names (i.e. 'Important Bird Areas') and values are raster file names (i.e. importantbirdareas.tif).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create drop-down menus in the tool GUI, in getParameterInfo function I have used the parameter.filter.list() function on a list of the keys from my raster dictionary. The user selects multiple raster inputs from the list of raster names.&lt;/P&gt;&lt;P&gt;In the execute function, I convert the multiple user input into a list using parameters[0].valueAsText.split(";"), which creates a list of raster names. I create an empty list for paths to my raster files, then iterate through the names in the raster name list, passing each raster name into the raster_dict.get() function to retrieve the corresponding raster file name in the dictionary. I concatenate the raster file name to the end of the path to the folder where the raster file is stored, and then append each path to the raster paths list. The list of paths is the input for the rest of my script (a raster calculation, zonal stats, and spatial join).&lt;/P&gt;&lt;P&gt;The tool fails at the concatenate step:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;File "", line 107, in execute TypeError: can only concatenate str (not "NoneType") to str&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After debugging, I found that the problem is with passing my raster names into the raster_dict.get() function. raster_dict.get() is returning nothing, meaning there is no “match” between the dictionary keys and the raster names passed to the get() function. I have tested the code in IDLE (replacing the parameters[0].valueAsText with hard-coded values), and it runs as expected. I have also used Messages in the Python Toolbox to check that the variable I am passing to the get() function is a string that matches one of the keys in raster_dict.&lt;/P&gt;&lt;P&gt;I have also tried rewriting the code without dictionaries, using lists instead. When I try to match the input parameter(s) to a value in the list (for example: if raster_name in raster_name_list), the code still fails, not recognizing the matching values.&lt;/P&gt;&lt;P&gt;The error occurs in the second line of the following block:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;for&lt;/SPAN&gt; key &lt;SPAN class=""&gt;in&lt;/SPAN&gt; raster_names:
   raster_path = &lt;SPAN class=""&gt;"F:\\GIS\\SEALT_prioritization\\Rasters\\"&lt;/SPAN&gt; + raster_dict.get(key)
   rasterList.append(raster_path)&lt;/PRE&gt;&lt;P&gt;Here is my complete .pyt:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class=""&gt;from&lt;/SPAN&gt; arcpy.sa &lt;SPAN class=""&gt;import&lt;/SPAN&gt; *
&lt;SPAN class=""&gt;from&lt;/SPAN&gt; arcpy.ia &lt;SPAN class=""&gt;import&lt;/SPAN&gt; *
&lt;SPAN class=""&gt;import&lt;/SPAN&gt; os

&lt;SPAN class=""&gt;class&lt;/SPAN&gt; &lt;SPAN class=""&gt;Toolbox&lt;/SPAN&gt;(&lt;SPAN class=""&gt;object&lt;/SPAN&gt;):
    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;__init__&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""Define the toolbox (the name of the toolbox is the name of the
        .pyt file)."""&lt;/SPAN&gt;
        self.label = &lt;SPAN class=""&gt;"SEALT Prioritization Python Toolbox"&lt;/SPAN&gt;
        self.alias = &lt;SPAN class=""&gt;"prioritize"&lt;/SPAN&gt;

        &lt;SPAN class=""&gt;# List of tool classes associated with this toolbox&lt;/SPAN&gt;
        self.tools = [PrioritizeParcels]

&lt;SPAN class=""&gt;class&lt;/SPAN&gt; &lt;SPAN class=""&gt;PrioritizeParcels&lt;/SPAN&gt;(&lt;SPAN class=""&gt;object&lt;/SPAN&gt;):
    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;__init__&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""Define the tool (tool name is the name of the class)."""&lt;/SPAN&gt;
        self.label = &lt;SPAN class=""&gt;"Prioritize Parcels"&lt;/SPAN&gt;
        self.description = &lt;SPAN class=""&gt;"This tool accepts multiple raster layer inputs and sums the overlaid pixels Then it averages the pixel values within the polygons of a designated feature class."&lt;/SPAN&gt;
        self.canRunInBackground = &lt;SPAN class=""&gt;False&lt;/SPAN&gt;

    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;getParameterInfo&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""Define parameter definitions"""&lt;/SPAN&gt;
        input_rasters = arcpy.Parameter(
            name=&lt;SPAN class=""&gt;"input_rasters"&lt;/SPAN&gt;,
            displayName=&lt;SPAN class=""&gt;"Select input datasets"&lt;/SPAN&gt;,
            datatype=&lt;SPAN class=""&gt;"GPString"&lt;/SPAN&gt;,
            parameterType=&lt;SPAN class=""&gt;"Required"&lt;/SPAN&gt;,
            direction=&lt;SPAN class=""&gt;"Input"&lt;/SPAN&gt;,
            multiValue=&lt;SPAN class=""&gt;True&lt;/SPAN&gt;)

        raster_dict={&lt;SPAN class=""&gt;"Freshwater forested shrub wetland"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'Freshwater_Forested_Shrub_Wetland.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Anadromous waters"&lt;/SPAN&gt;:
                    &lt;SPAN class=""&gt;'MergedBuffer_300ft_AWC.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Eelgrass"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedBuffer_300ft_Eelgrass.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Estuarine and marine wetlands"&lt;/SPAN&gt;:
                     &lt;SPAN class=""&gt;'MergedBuffer_300ft_Estuarine_Marine_Wetlands.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Public Lands"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'MergedBuffer_300ft_PublicLands.tif'&lt;/SPAN&gt;,
                     &lt;SPAN class=""&gt;"Rivers and streams"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedBuffer_300ft_Rivers_Streams.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Lakes and ponds"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedBuffer_300ft_Waterbodies.tif'&lt;/SPAN&gt;,
                     &lt;SPAN class=""&gt;"Freshwater emergent wetlands"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedFreshwater_Emergent_Wetland.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Important Bird Areas"&lt;/SPAN&gt;:
                     &lt;SPAN class=""&gt;'mergedibas'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Productive old growth forest"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'mergedpog'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Protected areas"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'protected'&lt;/SPAN&gt;}
        input_rasters.&lt;SPAN class=""&gt;filter&lt;/SPAN&gt;.&lt;SPAN class=""&gt;type&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"ValueList"&lt;/SPAN&gt;
        input_rasters.&lt;SPAN class=""&gt;filter&lt;/SPAN&gt;.&lt;SPAN class=""&gt;list&lt;/SPAN&gt;= &lt;SPAN class=""&gt;list&lt;/SPAN&gt;(raster_dict.keys())
            
        in_parcels = arcpy.Parameter(
            displayName=&lt;SPAN class=""&gt;"Select parcels to be scored"&lt;/SPAN&gt;,
            name=&lt;SPAN class=""&gt;"in_parcels"&lt;/SPAN&gt;,
            datatype=&lt;SPAN class=""&gt;"GPString"&lt;/SPAN&gt;,
            parameterType=&lt;SPAN class=""&gt;"Required"&lt;/SPAN&gt;,
            direction=&lt;SPAN class=""&gt;"Input"&lt;/SPAN&gt;)
            &lt;SPAN class=""&gt;#,multiValue=True)&lt;/SPAN&gt;

        service_area_dict={&lt;SPAN class=""&gt;"Yakutat"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'YakutatParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Wrangell"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'WrangellParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Sitka"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'SitkaParcels'&lt;/SPAN&gt;,
                            &lt;SPAN class=""&gt;"Petersburg"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'Petersburg_Lots'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Ketchikan"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'KetchikanParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Juneau"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'JuneauParcels'&lt;/SPAN&gt;,
                            &lt;SPAN class=""&gt;"Haines"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'HainesParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Skagway"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'SkagwayParcels'&lt;/SPAN&gt;}
        in_parcels.&lt;SPAN class=""&gt;filter&lt;/SPAN&gt;.&lt;SPAN class=""&gt;type&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"ValueList"&lt;/SPAN&gt;
        in_parcels.&lt;SPAN class=""&gt;filter&lt;/SPAN&gt;.&lt;SPAN class=""&gt;list&lt;/SPAN&gt;= &lt;SPAN class=""&gt;list&lt;/SPAN&gt;(service_area_dict.keys())

        out_path = arcpy.Parameter(
            name=&lt;SPAN class=""&gt;"out_path"&lt;/SPAN&gt;,
            displayName=&lt;SPAN class=""&gt;"Save results as"&lt;/SPAN&gt;,
            datatype= &lt;SPAN class=""&gt;"GPString"&lt;/SPAN&gt;,
            parameterType=&lt;SPAN class=""&gt;"Required"&lt;/SPAN&gt;,
            direction=&lt;SPAN class=""&gt;"Output"&lt;/SPAN&gt;)
            

        parameters = [input_rasters, in_parcels, out_path]
        &lt;SPAN class=""&gt;return&lt;/SPAN&gt; parameters
  

    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;isLicensed&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""Set whether tool is licensed to execute."""&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;True&lt;/SPAN&gt;

    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;updateParameters&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self, parameters&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""Modify the values and properties of parameters before internal
        validation is performed.  This method is called whenever a parameter
        has been changed."""&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;return&lt;/SPAN&gt;


    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;updateMessages&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self, parameters&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""Modify the messages created by internal validation for each tool
        parameter.  This method is called after internal validation."""&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;return&lt;/SPAN&gt;

    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;execute&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self, parameters, messages&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""The source code of the tool."""&lt;/SPAN&gt;

        &lt;SPAN class=""&gt;#arcpy.env.workspace = r"F:\GIS\SEALT_prioritization\Rasters"&lt;/SPAN&gt;
        arcpy.env.overwriteOutput = &lt;SPAN class=""&gt;True&lt;/SPAN&gt;

        raster_dict={&lt;SPAN class=""&gt;"Freshwater forested shrub wetland"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'Freshwater_Forested_Shrub_Wetland.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Anadromous waters"&lt;/SPAN&gt;:
                    &lt;SPAN class=""&gt;'MergedBuffer_300ft_AWC.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Eelgrass"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedBuffer_300ft_Eelgrass.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Estuarine and marine wetlands"&lt;/SPAN&gt;:
                     &lt;SPAN class=""&gt;'MergedBuffer_300ft_Estuarine_Marine_Wetlands.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Public Lands"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'MergedBuffer_300ft_PublicLands.tif'&lt;/SPAN&gt;,
                     &lt;SPAN class=""&gt;"Rivers and streams"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedBuffer_300ft_Rivers_Streams.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Lakes and ponds"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedBuffer_300ft_Waterbodies.tif'&lt;/SPAN&gt;,
                     &lt;SPAN class=""&gt;"Freshwater emergent wetlands"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'MergedFreshwater_Emergent_Wetland.tif'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Important Bird Areas"&lt;/SPAN&gt;:
                     &lt;SPAN class=""&gt;'mergedibas'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Productive old growth forest"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'mergedpog'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Protected areas"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'protected'&lt;/SPAN&gt;}

        service_area_dict={&lt;SPAN class=""&gt;"Yakutat"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'YakutatParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Wrangell"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'WrangellParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Sitka"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'SitkaParcels'&lt;/SPAN&gt;,
                            &lt;SPAN class=""&gt;"Petersburg"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'Petersburg_Lots'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Ketchikan"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'KetchikanParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Juneau"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'JuneauParcels'&lt;/SPAN&gt;,
                            &lt;SPAN class=""&gt;"Haines"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'HainesParcels'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Skagway"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'SkagwayParcels'&lt;/SPAN&gt;}

        raster_names=parameters[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;].valueAsText.split(&lt;SPAN class=""&gt;";"&lt;/SPAN&gt;)
        rasterList = []

        &lt;SPAN class=""&gt;for&lt;/SPAN&gt; key &lt;SPAN class=""&gt;in&lt;/SPAN&gt; raster_names:
            raster_path = &lt;SPAN class=""&gt;"F:\\GIS\\SEALT_prioritization\\Rasters\\"&lt;/SPAN&gt; + raster_dict.get(key)
            rasterList.append(raster_path)

        rasterCount = &lt;SPAN class=""&gt;len&lt;/SPAN&gt;(rasterList)

        &lt;SPAN class=""&gt;if&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;11&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            ras5 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;4&lt;/SPAN&gt;])
            ras6 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;5&lt;/SPAN&gt;])
            ras7 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;6&lt;/SPAN&gt;])
            ras8 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;7&lt;/SPAN&gt;])
            ras9 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;8&lt;/SPAN&gt;])
            ras10 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;9&lt;/SPAN&gt;])
            ras11 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;10&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4 + ras5 + ras6 + ras7 + ras8 + ras9 + ras10 + ras11

        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;10&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            ras5 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;4&lt;/SPAN&gt;])
            ras6 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;5&lt;/SPAN&gt;])
            ras7 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;6&lt;/SPAN&gt;])
            ras8 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;7&lt;/SPAN&gt;])
            ras9 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;8&lt;/SPAN&gt;])
            ras10 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;9&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4 + ras5 + ras6 + ras7 + ras8 + ras9 + ras10
  
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;9&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            ras5 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;4&lt;/SPAN&gt;])
            ras6 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;5&lt;/SPAN&gt;])
            ras7 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;6&lt;/SPAN&gt;])
            ras8 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;7&lt;/SPAN&gt;])
            ras9 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;8&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4 + ras5 + ras6 + ras7 + ras8 + ras9
    
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;8&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            ras5 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;4&lt;/SPAN&gt;])
            ras6 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;5&lt;/SPAN&gt;])
            ras7 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;6&lt;/SPAN&gt;])
            ras8 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;7&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4 + ras5 + ras6 + ras7 + ras8
            
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;7&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            ras5 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;4&lt;/SPAN&gt;])
            ras6 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;5&lt;/SPAN&gt;])
            ras7 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;6&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4 + ras5 + ras6 + ras7
           
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;6&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            ras5 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;4&lt;/SPAN&gt;])
            ras6 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;5&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4 + ras5 + ras6
            
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;5&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            ras5 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;4&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4 + ras5
            
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;4&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            ras4 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;3&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3 + ras4
            
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;3&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            ras3 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;])
            outRaster = ras1 + ras2 + ras3
            
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;2&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            ras2 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;])
            outRaster = ras1 + ras2
            
        &lt;SPAN class=""&gt;elif&lt;/SPAN&gt; rasterCount == &lt;SPAN class=""&gt;1&lt;/SPAN&gt;:
            ras1 = arcpy.Raster(rasterList[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;])
            outRaster = ras1
            
        serviceArea = parameters[&lt;SPAN class=""&gt;1&lt;/SPAN&gt;].valueAsText
        parcels = &lt;SPAN class=""&gt;"F:\\GIS\\Projects\\Tongass\\SEALTrust_Prioritization\\SEALT.gdb\\Parcels\\"&lt;/SPAN&gt; + service_area_dict.get(serviceArea)

        zonalStats = ZonalStatistics(in_zone_data=parcels, zone_field=&lt;SPAN class=""&gt;"primary_key"&lt;/SPAN&gt;, in_value_raster=outRaster, statistics_type=&lt;SPAN class=""&gt;"MEAN"&lt;/SPAN&gt;, ignore_nodata=&lt;SPAN class=""&gt;"DATA"&lt;/SPAN&gt;)
        &lt;SPAN class=""&gt;#zonalStats.save(r"F:\GIS\SEALT_prioritization\Output\zonal_out")&lt;/SPAN&gt;

        centroids = &lt;SPAN class=""&gt;r"memory\centroids"&lt;/SPAN&gt;
        out_points = &lt;SPAN class=""&gt;r"memory\outPoints"&lt;/SPAN&gt;

        arcpy.management.FeatureToPoint(in_features=parcels, out_feature_class=centroids, point_location=&lt;SPAN class=""&gt;"INSIDE"&lt;/SPAN&gt;)

        ExtractValuesToPoints(in_point_features=centroids, in_raster=zonalStats,out_point_features=out_points,
                              interpolate_values=&lt;SPAN class=""&gt;"NONE"&lt;/SPAN&gt;, add_attributes=&lt;SPAN class=""&gt;"VALUE_ONLY"&lt;/SPAN&gt;)

        scoredParcels = parameters[&lt;SPAN class=""&gt;2&lt;/SPAN&gt;].valueAsText

        arcpy.analysis.SpatialJoin(target_features=parcels, join_features=out_points, out_feature_class=scoredParcels,
                                   join_operation=&lt;SPAN class=""&gt;"JOIN_ONE_TO_ONE"&lt;/SPAN&gt;, join_type=&lt;SPAN class=""&gt;"KEEP_ALL"&lt;/SPAN&gt;, match_option=&lt;SPAN class=""&gt;"CONTAINS"&lt;/SPAN&gt;)

        &lt;SPAN class=""&gt;return&lt;/SPAN&gt;

    &lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;postExecute&lt;/SPAN&gt;(&lt;SPAN class=""&gt;self, parameters&lt;/SPAN&gt;):
        &lt;SPAN class=""&gt;"""This method takes place after outputs are outputs are processed and
        added to the display."""&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Oct 2022 23:01:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-toolbox-can-t-match-input-parameter-to/m-p/1225494#M61556</guid>
      <dc:creator>elmort</dc:creator>
      <dc:date>2022-10-25T23:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox can't match input parameter to dictionary key in dictionary.get() function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-toolbox-can-t-match-input-parameter-to/m-p/1225517#M61558</link>
      <description>&lt;P&gt;For some reason the split of the parameter(0) is returning a quoted list ie the variable raster_names looks like ["'Freshwater forested shrub wetland'", "'Anadromous waters'"] and these do not match your raster dict so the get is returning None. You can simply remove the single quotes when you reference 'key' in your raster_name loop, eg&amp;nbsp;raster_path = "F:\\GIS\\SEALT_prioritization\\Rasters\\" + raster_dict.get(key.replace("'", "")) or you can try and figure out why the list is quoted.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 01:14:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-toolbox-can-t-match-input-parameter-to/m-p/1225517#M61558</guid>
      <dc:creator>graeme_hill</dc:creator>
      <dc:date>2022-10-26T01:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox can't match input parameter to dictionary key in dictionary.get() function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-toolbox-can-t-match-input-parameter-to/m-p/1226478#M61675</link>
      <description>&lt;P&gt;Thanks, Graeme. I resolved it with the .strip() function in the for loop.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 01:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-toolbox-can-t-match-input-parameter-to/m-p/1226478#M61675</guid>
      <dc:creator>elmort</dc:creator>
      <dc:date>2022-10-28T01:25:49Z</dc:date>
    </item>
  </channel>
</rss>

