<?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: Using Make Layer works in Pro but not in a GP tool in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1558846#M27463</link>
    <description>&lt;P&gt;After many hours I figured out that the MakeRasterLayer just plain will not take input from MakeMultidimensionalLayer - even though it works in Pro, it will not on the server.&lt;/P&gt;&lt;P&gt;So I changed to&amp;nbsp;&lt;BR /&gt;TrendRaster_pval = arcpy.ia.ExtractBand("oneInd", [2])&lt;/P&gt;&lt;P&gt;and that worked.&amp;nbsp; But did not in Pro.&amp;nbsp; So weird.&lt;/P&gt;&lt;P&gt;The server seems to not handle temp in memory layers the same way.&amp;nbsp; It gets lost.&amp;nbsp; Next had the same issue with a polygon input from the GP widget.&amp;nbsp; There I must save it to scratch GDB or it will never draw.&amp;nbsp; But that works fine in Pro.&lt;/P&gt;&lt;P&gt;Hopes that helps someone.&amp;nbsp; GP tools are such a mystery.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2024 19:54:17 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2024-11-14T19:54:17Z</dc:date>
    <item>
      <title>Using Make Layer works in Pro but not in a GP tool</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1556987#M27459</link>
      <description>&lt;P&gt;Been testing an infinite number of combinations the last few days and still cannot get it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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 and then I can do either of these and it works.&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:25:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1556987#M27459</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-11-08T20:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Make Layer works in Pro but not in a GP tool</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1557814#M27461</link>
      <description>&lt;P&gt;Is maybe the help wrong.&amp;nbsp; Why is a temp layer getting a path and file extension?&lt;/P&gt;&lt;P&gt;From the help&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Import system modules
import arcpy

# Define input parameters
in_multidimensional_raster = r"C:\data\MD_Ocean_data.crf"
out_multidimensional_raster_layer = r"C:\data\Temp_slice.crf"
variables = "water_temp"
dimension_def = "BY_VALUE"
dimension_values = "StdZ -50;StdZ -100"
template = "120.084279939743 0.914964278021376 139.524470909773 21.1231086159414"

#Execute

arcpy.md.MakeMultidimensionalRasterLayer(
	in_multidimensional_raster, out_multidimensional_raster_layer, variables, 
	dimension_def, dimension_values, template)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Nov 2024 23:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1557814#M27461</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-11-12T23:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using Make Layer works in Pro but not in a GP tool</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1558846#M27463</link>
      <description>&lt;P&gt;After many hours I figured out that the MakeRasterLayer just plain will not take input from MakeMultidimensionalLayer - even though it works in Pro, it will not on the server.&lt;/P&gt;&lt;P&gt;So I changed to&amp;nbsp;&lt;BR /&gt;TrendRaster_pval = arcpy.ia.ExtractBand("oneInd", [2])&lt;/P&gt;&lt;P&gt;and that worked.&amp;nbsp; But did not in Pro.&amp;nbsp; So weird.&lt;/P&gt;&lt;P&gt;The server seems to not handle temp in memory layers the same way.&amp;nbsp; It gets lost.&amp;nbsp; Next had the same issue with a polygon input from the GP widget.&amp;nbsp; There I must save it to scratch GDB or it will never draw.&amp;nbsp; But that works fine in Pro.&lt;/P&gt;&lt;P&gt;Hopes that helps someone.&amp;nbsp; GP tools are such a mystery.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 19:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-make-layer-works-in-pro-but-not-in-a-gp-tool/m-p/1558846#M27463</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-11-14T19:54:17Z</dc:date>
    </item>
  </channel>
</rss>

