<?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: passing the output of a tool as input to another in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330654#M25732</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here inRaster is just a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="_jivemacro_uid_14502461076324024 jive_macro_code jive_text_macro" data-renderedposition="50_8_912_71" jivemacro_uid="_14502461076324024" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN class="comment"&gt;# Spatially Balanced Points&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRaster = &lt;SPAN class="string"&gt;"rcls"&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outPoints = &lt;SPAN class="string"&gt;"C:/Results/ArcMap/Visibility/Calc_View/point" + str(n)&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateSpatiallyBalancedPoints_ga(inRaster, &lt;SPAN class="number"&gt;1, outPoints)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="number"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;Why not just use your raster object outReclass.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2015 06:09:37 GMT</pubDate>
    <dc:creator>NeilAyres</dc:creator>
    <dc:date>2015-12-16T06:09:37Z</dc:date>
    <item>
      <title>passing the output of a tool as input to another</title>
      <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330652#M25730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello I have the following code (its a bit big but very simple), and the problem I am facing is that I cannot pass the raster rcls to the Create Spatially Balanced tool, unless I add it to Table of Contents (lines 32- 42). I am building a new tool, so I don't want to interrupt the proccess by adding something to the Talbe of Contents, cracking my tool to 2 tools. The "values" and "num_pnts" variable (line 13-14) show the number of points that will be created. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os
from arcpy import env
from arcpy.sa import *


#workspace = arcpy.GetParameterAsText(0)
workspace = "C:/Results/ArcMap/Visibility/Calc_View/"


# arithmos simion kai viewsheds
#value = arcpy.GetParameterAsText(1)
values = 2
num_pnts = int(values)


#height_val = arcpy.GetParameterAsText(2)
height_val = 100
height = int(height_val)


#demodel = arcpy.GetParameterAsText(3)
#demMAXResult = arcpy.GetRasterProperties_management(demodel, "MAXIMUM")
#demMAXResult = arcpy.GetRasterProperties_management(demodel, "MINIMUM")
demMAXResult = arcpy.GetRasterProperties_management("C:/Results/ArcMap/Visibility/Calc_View/tin2ras3g_1", "MAXIMUM")
demMINResult = arcpy.GetRasterProperties_management("C:/Results/ArcMap/Visibility/Calc_View/tin2ras3g_1", "MINIMUM")
demMAX = demMAXResult.getOutput(0)
demMIN = demMINResult.getOutput(0)
LIMIT = float(demMAX) - height


# Reclassify
outReclass = Reclassify("tin2ras3g_1", "Value", RemapRange([[float(demMIN),LIMIT,1],[LIMIT,demMAX,0]]), "NODATA")
outReclass.save("C:/Results/ArcMap/Visibility/Calc_View/rcls")

n = 0
for i in range(num_pnts):
&amp;nbsp;&amp;nbsp;&amp;nbsp; n += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Spatially Balanced Points
&amp;nbsp;&amp;nbsp;&amp;nbsp; inRaster = "rcls"
&amp;nbsp;&amp;nbsp;&amp;nbsp; outPoints = "C:/Results/ArcMap/Visibility/Calc_View/point" + str(n)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateSpatiallyBalancedPoints_ga(inRaster, 1, outPoints)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330652#M25730</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2021-12-11T15:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: passing the output of a tool as input to another</title>
      <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330653#M25731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The help (&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00300000000q000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//00300000000q000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; ) states the 1st parameter "in_probability_raster" should be a Raster Layer or a Mosaic Layer, not a Raster Dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you add the Raster Dataset to the TOC, you create a Raster Layer which works in the tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try creating a Raster Layer with the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Make_Raster_Layer/00170000006t000000/"&gt;Make Raster Layer (Data Management) &lt;/A&gt;​tool and pass that as the "in_probability_raster" parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 03:53:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330653#M25731</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2015-12-16T03:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: passing the output of a tool as input to another</title>
      <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330654#M25732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here inRaster is just a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="_jivemacro_uid_14502461076324024 jive_macro_code jive_text_macro" data-renderedposition="50_8_912_71" jivemacro_uid="_14502461076324024" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN class="comment"&gt;# Spatially Balanced Points&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inRaster = &lt;SPAN class="string"&gt;"rcls"&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outPoints = &lt;SPAN class="string"&gt;"C:/Results/ArcMap/Visibility/Calc_View/point" + str(n)&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateSpatiallyBalancedPoints_ga(inRaster, &lt;SPAN class="number"&gt;1, outPoints)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="number"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;Why not just use your raster object outReclass.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 06:09:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330654#M25732</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-12-16T06:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: passing the output of a tool as input to another</title>
      <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330655#M25733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neil I also tried to put &lt;/P&gt;&lt;P&gt;inRaster = "outReclass"&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;but with no result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:37:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330655#M25733</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2015-12-16T10:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: passing the output of a tool as input to another</title>
      <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330656#M25734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried it your way but although I put again&amp;nbsp; workspace = ... and the makeRasterLayer_management("rcls", "rclsLayer, "") I get only an&lt;/P&gt;&lt;P&gt;Parameters are not valid. ERROR 000865: Input raster: rcls does not exist. Failed to execute (MakeRasterLayer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code after the reclassification can run only if I put rcls to the table of contents, something influences that but I don't know why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 11:11:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330656#M25734</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2015-12-16T11:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: passing the output of a tool as input to another</title>
      <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330657#M25735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved at line 40 at the variable inRaster, it must be imported the path of the reclassified raster like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14502665732383678 jive_text_macro" data-renderedposition="47.99715805053711_7.997159004211426_912_15" jivemacro_uid="_14502665732383678"&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #000000; font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif;"&gt;inRaster = &lt;SPAN style="color: #0000ff; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;"C:/Results/ArcMap/Visibility/Calc_View/rcls"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why, it is the first time I am doing it, but only by that it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 11:56:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330657#M25735</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2015-12-16T11:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: passing the output of a tool as input to another</title>
      <link>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330658#M25736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kon,&lt;/P&gt;&lt;P&gt;here you are assigning the variable inRaster to the string "outReclass"&lt;/P&gt;&lt;P&gt;Not the raster object which is outReclass.&lt;/P&gt;&lt;P&gt;But yes, you can save it and put the full pointer to it, as you have indicated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 15:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-the-output-of-a-tool-as-input-to-another/m-p/330658#M25736</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-12-16T15:25:49Z</dc:date>
    </item>
  </channel>
</rss>

