<?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 Using Make Layer works in Pro but not in a GP tool in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1556985#M73165</link>
    <description>&lt;P&gt;Been testing an infinite number of combinations the last few days and still cannot get it.&amp;nbsp; This all works great in Pro/PyScripter, and it does publish, but when running as a GP tool I get the message&amp;nbsp; ERROR 003401: Invalid or unsupported input raster. Failed to execute (MakeRasterLayer).&lt;/P&gt;&lt;P&gt;Pro 3.1 and Server 11.3&lt;/P&gt;&lt;P&gt;RAPTrendRaster = arcpy.ia.GenerateTrendRaster("yearsRaster", "StdTime", runIndicators, "MANN-KENDALL", None, "DATA", None, "", "RMSE", "NO_R2", "NO_SLOPEPVALUE", "")&lt;/P&gt;&lt;P&gt;oneIndLayer = arcpy.md.MakeMultidimensionalRasterLayer(RAPTrendRaster, "oneInd", indToMap)[0]&lt;BR /&gt;arcpy.AddMessage(oneIndLayer)&amp;nbsp; &amp;nbsp;# nothing prints here on the server but in Pro I get&amp;nbsp;&amp;lt;MappingLayerObject object at 0x0000021636EA4D20&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;pvalLayer = arcpy.management.MakeRasterLayer(oneIndLayer, "RAPTrendRaster_pval", band_index=[2])[0]&lt;/P&gt;&lt;P&gt;The last line fails with: Invalid or unsupported input raster.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I run it all in PyScripter. There I can do&lt;/P&gt;&lt;P&gt;pvalLayer = arcpy.management.MakeRasterLayer(oneIndLayer, "RAPTrendRaster_pval", band_index=[2])[0]&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;pvalLayer = arcpy.management.MakeRasterLayer("oneInd", "RAPTrendRaster_pval", band_index=[2])[0]&lt;/P&gt;&lt;P&gt;And it works just fine.&lt;/P&gt;&lt;P&gt;My guess is its either not storing the layer file at all or it is not pathing right.&amp;nbsp; Of course its remapping some of my vars but its just repalcing ESRI_Var and then that gets&amp;nbsp;oneIndLayer&lt;/P&gt;&lt;P&gt;I guess my question is how do I use layer files in a GeoProcessing tool?&amp;nbsp; Cannot find anything about it.&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2024 20:21:56 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2024-11-08T20:21:56Z</dc:date>
    <item>
      <title>Using Make Layer works in Pro but not in a GP tool</title>
      <link>https://community.esri.com/t5/python-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1556985#M73165</link>
      <description>&lt;P&gt;Been testing an infinite number of combinations the last few days and still cannot get it.&amp;nbsp; This all works great in Pro/PyScripter, and it does publish, but when running as a GP tool I get the message&amp;nbsp; ERROR 003401: Invalid or unsupported input raster. Failed to execute (MakeRasterLayer).&lt;/P&gt;&lt;P&gt;Pro 3.1 and Server 11.3&lt;/P&gt;&lt;P&gt;RAPTrendRaster = arcpy.ia.GenerateTrendRaster("yearsRaster", "StdTime", runIndicators, "MANN-KENDALL", None, "DATA", None, "", "RMSE", "NO_R2", "NO_SLOPEPVALUE", "")&lt;/P&gt;&lt;P&gt;oneIndLayer = arcpy.md.MakeMultidimensionalRasterLayer(RAPTrendRaster, "oneInd", indToMap)[0]&lt;BR /&gt;arcpy.AddMessage(oneIndLayer)&amp;nbsp; &amp;nbsp;# nothing prints here on the server but in Pro I get&amp;nbsp;&amp;lt;MappingLayerObject object at 0x0000021636EA4D20&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;pvalLayer = arcpy.management.MakeRasterLayer(oneIndLayer, "RAPTrendRaster_pval", band_index=[2])[0]&lt;/P&gt;&lt;P&gt;The last line fails with: Invalid or unsupported input raster.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I run it all in PyScripter. There I can do&lt;/P&gt;&lt;P&gt;pvalLayer = arcpy.management.MakeRasterLayer(oneIndLayer, "RAPTrendRaster_pval", band_index=[2])[0]&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;pvalLayer = arcpy.management.MakeRasterLayer("oneInd", "RAPTrendRaster_pval", band_index=[2])[0]&lt;/P&gt;&lt;P&gt;And it works just fine.&lt;/P&gt;&lt;P&gt;My guess is its either not storing the layer file at all or it is not pathing right.&amp;nbsp; Of course its remapping some of my vars but its just repalcing ESRI_Var and then that gets&amp;nbsp;oneIndLayer&lt;/P&gt;&lt;P&gt;I guess my question is how do I use layer files in a GeoProcessing tool?&amp;nbsp; Cannot find anything about it.&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 20:21:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1556985#M73165</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-11-08T20:21:56Z</dc:date>
    </item>
  </channel>
</rss>

