<?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: divide tool in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/divide-tool/m-p/265201#M20410</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you, I again tried your code of course with a little change and&amp;nbsp; fortunately this time it was work.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;That's good. Please click the check mark next to my post to indicate it answered your question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I plan to do this work about about Fuzzy membership and Weighted sum with 5 layer. can you help me about these?&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;You should start a new thread with your new question.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2014 19:15:19 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2014-06-24T19:15:19Z</dc:date>
    <item>
      <title>divide tool</title>
      <link>https://community.esri.com/t5/python-questions/divide-tool/m-p/265197#M20406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to build a toolset by using add a script that before I had provided in Pythonwin, this tool divide one raster by maximum value from that raster for normalization it. I found that by command arcpy.getParameterAsText(), we can give flexibility to toolset for introducing parameters. but in case Divide operation, we only can introduce raster1 or constant1 and raster2 or constant2 and I don't know determine name and path of output using arcpy.getParameterAsText() like operations of Buffer, clip and so on. I look forward for your helpful answers. Meanwhile I pasted the script as follows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy.sa import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get the input parameters for &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inPath = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;constant = arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #outPath = arcpy.GetParameterAsText(2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #bufferDistance = arcpy.GetParameterAsText(2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Run the Buffer tool&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Divide(inPath,constant)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #env.workspace = outPath&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Report a success message&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddMessage("All done!")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 21:12:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/divide-tool/m-p/265197#M20406</guid>
      <dc:creator>mohamadbakhtiari</dc:creator>
      <dc:date>2014-06-23T21:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: divide tool</title>
      <link>https://community.esri.com/t5/python-questions/divide-tool/m-p/265198#M20407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000051000000" rel="nofollow" target="_blank"&gt;Raster&lt;/A&gt;&lt;SPAN&gt; class to create a Raster object from your input filename.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy from arcpy import env from arcpy.sa import * import os arcpy.env.overwriteOutput = True&amp;nbsp; # Get the input parameters for&amp;nbsp; inPath = arcpy.GetParameterAsText(0) constant = int(arcpy.GetParameterAsText(1)) #convert to integer outPath = arcpy.GetParameterAsText(2)&amp;nbsp; # Run the Divide tool result = Divide(Raster(inPath),constant) result.save(os.path.join(outPath, "someraster"))&amp;nbsp; # Report a success message&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("All done!")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 07:11:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/divide-tool/m-p/265198#M20407</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2014-06-24T07:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: divide tool</title>
      <link>https://community.esri.com/t5/python-questions/divide-tool/m-p/265199#M20408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi lpinner&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you, I tested you code in the toolset but when a number (with Double type) introduced for division rater by it, that doesn't work and the error message was " ERROR 000732: Input Raster: Dataset 7 does not exist or is not supported Failed to execute (Script)". then I introduced a raster (with Raster layer type). Unfortunately again it wasnot work. the error message is: "ERROR 000875: Output raster: I:\Session7\gt\someraster's workspace is an invalid output workspace.". I don't know what do. I plan to do this task about Fuzzy membership and Weighted sum.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;please help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mohsen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 10:26:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/divide-tool/m-p/265199#M20408</guid>
      <dc:creator>mohamadbakhtiari</dc:creator>
      <dc:date>2014-06-24T10:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: divide tool</title>
      <link>https://community.esri.com/t5/python-questions/divide-tool/m-p/265200#M20409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi lpinner&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, I again tried your code of course with a little change and&amp;nbsp; fortunately this time it was work. I remove the "someraster" from method of save and the result aw OK. I plan to do this work about about Fuzzy membership and Weighted sum with 5 layer. can you help me about these?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regard &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mohsen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 15:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/divide-tool/m-p/265200#M20409</guid>
      <dc:creator>mohamadbakhtiari</dc:creator>
      <dc:date>2014-06-24T15:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: divide tool</title>
      <link>https://community.esri.com/t5/python-questions/divide-tool/m-p/265201#M20410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you, I again tried your code of course with a little change and&amp;nbsp; fortunately this time it was work.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;That's good. Please click the check mark next to my post to indicate it answered your question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I plan to do this work about about Fuzzy membership and Weighted sum with 5 layer. can you help me about these?&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;You should start a new thread with your new question.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 19:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/divide-tool/m-p/265201#M20410</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2014-06-24T19:15:19Z</dc:date>
    </item>
  </channel>
</rss>

