<?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: VBscript to group discrete integer polygon gridcodes into natural breaks using the Field Calculator in Spatial Data Science Questions</title>
    <link>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604452#M1372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is "Weight_NDVI" a string or numeric field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Nov 2019 17:34:17 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2019-11-22T17:34:17Z</dc:date>
    <item>
      <title>VBscript to group discrete integer polygon gridcodes into natural breaks using the Field Calculator</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604451#M1371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The goal was to use the weighted overlay tool to create a wetland suitability index using 3 indices: soil conditions, NDVI, and NDWI.&amp;nbsp; Originally the NDVI and NDWI were integer rasters but due to the soil map being a vector file i choose to convert the rasters to vector and go about weighting them using the Field Calculator.&amp;nbsp; &amp;nbsp;I would have used the weighted overlay but due to the wide range of values assigning every single scale value is a waste of time in my opinion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea was to emulate the natural breaks in the symbology as the groupings that would be assigned scale value&amp;nbsp;as such:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="249" src="https://community.esri.com/legacyfs/online/474446_pastedImage_1.png" width="272" /&gt;scale values range from 1-6, 1 = the lowest suitability and 6 = maximum suitability&lt;/P&gt;&lt;P&gt;@@&lt;/P&gt;&lt;P&gt;I have little to no experience with VBscript or Python so here is what i came up with referencing this page:&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/tables/calculate-field-examples.htm#ESRI_SECTION1_89F6A916BFA840528C57210D6B09125D" title="https://desktop.arcgis.com/en/arcmap/latest/manage-data/tables/calculate-field-examples.htm#ESRI_SECTION1_89F6A916BFA840528C57210D6B09125D"&gt;Calculate Field examples—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but due to syntax errors it doesn't work.&amp;nbsp; Hopefully someone can point me in the right direction or explain why the script is not working as intended.&amp;nbsp; &amp;nbsp;Here is a screenshot of the Field Calculator and the entire codeblock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/474447_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt;Expression:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt;Weight_NDVI&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt;Code Block:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If [gridcode]&amp;lt;-78 Then&lt;BR /&gt; [Weight_NDVI] = "1"&lt;/P&gt;&lt;P&gt;elseif [gridcode] &amp;gt;-78 And [gridcode]&amp;lt;153 Then&lt;BR /&gt; [Weight_NDVI] ="2"&lt;/P&gt;&lt;P&gt;elseif [gridcode]&amp;gt;153 And [gridcode]&amp;lt;397 Then&lt;BR /&gt; [Weight_NDVI] ="3"&lt;/P&gt;&lt;P&gt;elseif [gridcode]&amp;gt;397 And [gridcode]&amp;lt;613 Then&lt;BR /&gt; [Weight_NDVI] ="4"&lt;/P&gt;&lt;P&gt;elseif [gridcode]&amp;gt;613 And [gridcode]&amp;lt;756 Then&lt;BR /&gt; [Weight_NDVI] ="5"&lt;/P&gt;&lt;P&gt;elseif [gridcode]&amp;gt;756 And [gridcode]&amp;lt;999 Then&lt;BR /&gt; [Weight_NDVI] ="6"&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is much appreciated, even if it's only a forum link to help me figure it out myself!&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2019 16:51:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604451#M1371</guid>
      <dc:creator>TaylorRaihall</dc:creator>
      <dc:date>2019-11-22T16:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: VBscript to group discrete integer polygon gridcodes into natural breaks using the Field Calculator</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604452#M1372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is "Weight_NDVI" a string or numeric field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2019 17:34:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604452#M1372</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2019-11-22T17:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: VBscript to group discrete integer polygon gridcodes into natural breaks using the Field Calculator</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604453#M1373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Numeric, i just created a new field in the attribute table, type: double&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2019 17:42:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604453#M1373</guid>
      <dc:creator>TaylorRaihall</dc:creator>
      <dc:date>2019-11-22T17:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: VBscript to group discrete integer polygon gridcodes into natural breaks using the Field Calculator</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604454#M1374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, click the "Show Codeblock" option. Use this in the "Pre-Logic Script Code" area&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;dim temp
If &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gridcode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;78&lt;/SPAN&gt; Then
  temp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
elseif &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gridcode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;153&lt;/SPAN&gt; Then
  temp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;
elseif &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gridcode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;397&lt;/SPAN&gt; Then
  temp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;
elseif &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gridcode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;613&lt;/SPAN&gt; Then
  temp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;
elseif &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gridcode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;756&lt;/SPAN&gt; Then
  temp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;
elseif &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gridcode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;999&lt;/SPAN&gt; Then
  temp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;6&lt;/SPAN&gt; 
end &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and put this in the "[Weight_NDVI] ="&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;temp‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:55:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/vbscript-to-group-discrete-integer-polygon/m-p/604454#M1374</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-12T01:55:15Z</dc:date>
    </item>
  </channel>
</rss>

