<?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: use raster properties value in attribut table via inline variable in model builder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123898#M4325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you Thomas Stanley and Curtis Price, I've tried your suggestions. I'm a bit further but still can't get my &lt;/P&gt;&lt;P&gt;CalculateField to recognize the output of the GetRasterProperties in ModelBuilder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've split up the problem and made a model with just the CalculateField Tool and a model variable of type Double that is used to fill the field (see picture). So far, so good, that work's. &lt;IMG alt="FieldCalculator_Double.JPG" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/28883_FieldCalculator_Double.JPG" style="width: 620px; height: 696px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I try to use the Output of the GetRasterProperties Tool (Max_Value) instead of the variable %Double% in my field calculation. The model runs without error message but the field is not updated but stays empty.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldCalculator_GetRasterProperties.JPG" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/28884_FieldCalculator_GetRasterProperties.JPG" style="width: 620px; height: 560px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to write %Max_Value% instead of Max_Value in the expression line, but that does not make any difference to the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone could help me with this issue I would be most grateful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Nov 2014 11:20:06 GMT</pubDate>
    <dc:creator>DorotheaHeim</dc:creator>
    <dc:date>2014-11-10T11:20:06Z</dc:date>
    <item>
      <title>use raster properties value in attribut table via inline variable in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123895#M4322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a small model that should find the maximum value of a raster and use this number to fill a field in a shapefile. For some reason the variable of the rasters max value isn't accepted in the calculation of the new field in the shapefile. I just get a general 999999 error. I've attached an image for better understanding of the problem. The field I create in the model is of type DOUBLE because I read that the tool 'get raster properties' uses this datatype as output. I also tried using the modelbuilder only tool 'collect values' to save the maximum value in and feed it then into the calculation. Obviously that didn't work, otherwise I wouldn't ask here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone please explain to me why this isn't working and how to solve the problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, Thea&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 09:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123895#M4322</guid>
      <dc:creator>DorotheaHeim</dc:creator>
      <dc:date>2014-03-10T09:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: use raster properties value in attribut table via inline variable in model builde</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123896#M4323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried creating a test variable with a set value in MB?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If %Double% doesn't work, then it's not a problem with the raster table, but some other syntax. If %Double% does work, then it's a problem with how you are getting Max.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 18:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123896#M4323</guid>
      <dc:creator>ThomasStanley</dc:creator>
      <dc:date>2014-05-20T18:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: use raster properties value in attribut table via inline variable in model builde</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123897#M4324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Collect values is for collecting a list of values when running a iterations. I don't know why I keep seeing suggestions on the forums to use it to encapsulate single values in ModelBuilder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be helpful to show the ModelBuilder dialog (copy and paste the text into a post here). The messages in that dialog will show exactly how the syntax came through.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are three suggestions though:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Use a variable name that is not a reserved word. For example: "Max Value" instead of "Max". I don't know if that will help, but it's just good practice.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Connect the output of Get Raster Properties to the Calculate Field tool directly, assigning it to the 2parameter Expression. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Use PYTHON_9.3, not VB for expression_type - so the tool will run in 64 bit background geoprocessing successfully. (VB is not support in 64 bit).&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 21:19:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123897#M4324</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-05-20T21:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: use raster properties value in attribut table via inline variable in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123898#M4325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you Thomas Stanley and Curtis Price, I've tried your suggestions. I'm a bit further but still can't get my &lt;/P&gt;&lt;P&gt;CalculateField to recognize the output of the GetRasterProperties in ModelBuilder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've split up the problem and made a model with just the CalculateField Tool and a model variable of type Double that is used to fill the field (see picture). So far, so good, that work's. &lt;IMG alt="FieldCalculator_Double.JPG" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/28883_FieldCalculator_Double.JPG" style="width: 620px; height: 696px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I try to use the Output of the GetRasterProperties Tool (Max_Value) instead of the variable %Double% in my field calculation. The model runs without error message but the field is not updated but stays empty.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldCalculator_GetRasterProperties.JPG" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/28884_FieldCalculator_GetRasterProperties.JPG" style="width: 620px; height: 560px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to write %Max_Value% instead of Max_Value in the expression line, but that does not make any difference to the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone could help me with this issue I would be most grateful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 11:20:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123898#M4325</guid>
      <dc:creator>DorotheaHeim</dc:creator>
      <dc:date>2014-11-10T11:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: use raster properties value in attribut table via inline variable in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123899#M4326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;float(%Max_Value%)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The geoprocessing messages you get from ModelBuilder when you run the tool may be helpful - I'd look at them carefully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing you can verify is that your raster does return a maximum result from the tool at all. For examples, if it's all NoData, you won't get a result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 06:16:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123899#M4326</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-11-13T06:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: use raster properties value in attribut table via inline variable in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123900#M4327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your suggestion. I think I'm getting closer to the core of the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked in the geoprocessing results that I get an output from the GetRasterProperties (45,445). My ArcGIS is set up in German, therefore the comma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried to use &lt;/P&gt;&lt;PRE&gt;float(%Max_Value%)&lt;/PRE&gt;&lt;P&gt;but got an error message stating that float can take only one argument. So I assumed that the comma in my 54,445 is the problem and it actually should be 54.445 in order to be transformed into a float variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I exported the whole model into a script to be able to transform the datatyp. My script runs without any error messages but still the field is not filled with my 54.445.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# -*- coding: utf-8 -*-&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# ---------------------------------------------------------------------------&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# GetRasterProperties.py&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Created on: 2014-11-13 14:20:41.00000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Usage: GetRasterProperties &amp;lt;in_raster&amp;gt; &amp;lt;Table&amp;gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Description: &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# ---------------------------------------------------------------------------&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Import arcpy module&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;import arcpy&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Script arguments&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;in_raster = arcpy.GetParameterAsText(0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Table = arcpy.GetParameterAsText(1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Local variables:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Max_Value = in_raster&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# TableOut = Max_Value&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Process: Raster-Eigenschaften abrufen&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MaxWertResult = arcpy.GetRasterProperties_management(in_raster, "MAXIMUM", "")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Maximum als String in Variable speichern&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MaxWert = MaxWertResult.getOutput(0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# In MaxWert Komma durch Punkt ersetzen &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MaxWert2 = MaxWert.replace(",", ".")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# MaxWert2 in Float umwandeln&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MaxWertFl = float(MaxWert2)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Process: Feld berechnen&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;arcpy.CalculateField_management(Table, "Max2", MaxWertFl, "PYTHON_9.3", "")&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 13:53:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123900#M4327</guid>
      <dc:creator>DorotheaHeim</dc:creator>
      <dc:date>2014-11-13T13:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: use raster properties value in attribut table via inline variable in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123901#M4328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to verify the internationalization settings in Python are what they should be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.python.org/2/library/locale.html" title="https://docs.python.org/2/library/locale.html"&gt;22.2. locale — Internationalization services — Python 2.7.8 documentation&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Nov 2014 02:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123901#M4328</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-11-15T02:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: use raster properties value in attribut table via inline variable in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123902#M4329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Curtis Price, that did the trick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I set my ArcGIS to English, but that wasn't enough. I actually had to change the decimal sign for my whole computer to ".", now it works beautifully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANK YOU&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 08:47:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-raster-properties-value-in-attribut-table-via/m-p/123902#M4329</guid>
      <dc:creator>DorotheaHeim</dc:creator>
      <dc:date>2014-11-18T08:47:05Z</dc:date>
    </item>
  </channel>
</rss>

