<?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 Field Calculation: trying to define a value with the information of 2 columns in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculation-trying-to-define-a-value-with/m-p/1225765#M61586</link>
    <description>&lt;P&gt;Hi, I was trying to calculate a value using the information of 2 columns, I know that it needs to implement a python elif and function. But I don't know how to make it works. Here is my code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JaniceHau_0-1666805271677.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54487i9BC70217CB1D294A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JaniceHau_0-1666805271677.png" alt="JaniceHau_0-1666805271677.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code block:&lt;BR /&gt;def Resistance(x, y):&lt;BR /&gt;if x == "water":&lt;BR /&gt;return 100&lt;BR /&gt;elif x == "barrier":&lt;BR /&gt;return 100&lt;BR /&gt;elif x == "linear_feature" and y == "corridor" or y == "raceway" or y == "elevator":&lt;BR /&gt;return 100&lt;BR /&gt;elif x == "linear_feature" and y == "footway" or y == "bridleway" or y == "track" or y =="path", or y == "proposed" or y == "abandoned" or y == "rest area":&lt;BR /&gt;return 20&lt;BR /&gt;elif x == "linear_feature" and y == "motorway" or y == "motorway_link" or y == "trunk" or y == "trunk_link" or y == "escape" or y == "construction" or y == "turning loop":&lt;BR /&gt;return 70&lt;BR /&gt;elif x == "linear_feature" and y == "primary" or y == "secondary" or y == "tertiary" or y == "primary_link" or y =="secondary_link" or y == "tertiary_link" or y == "unclassified" or y == "road":&lt;BR /&gt;return 50&lt;BR /&gt;elif x == "linear_feature" and y == "residential" or y == "cycleway" or y == "living street" or y == "platform" or y =="bustop"&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "linear_feature" and y == "services" or y == "pedestrain" or y == "crossing" or y == "steps"&lt;BR /&gt;return 20&lt;BR /&gt;elif x == "residential":&lt;BR /&gt;return 40&lt;BR /&gt;elif x == "institutional":&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "open_green_area":&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "hetero_green_area":&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "dense_green_area":&lt;BR /&gt;return 20&lt;BR /&gt;elif x == "resourceful_green_area":&lt;BR /&gt;return 10&lt;BR /&gt;elif x == "building":&lt;BR /&gt;return 100&lt;BR /&gt;else:&lt;BR /&gt;return 0&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2022 17:28:34 GMT</pubDate>
    <dc:creator>JaniceHau</dc:creator>
    <dc:date>2022-10-26T17:28:34Z</dc:date>
    <item>
      <title>Field Calculation: trying to define a value with the information of 2 columns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculation-trying-to-define-a-value-with/m-p/1225765#M61586</link>
      <description>&lt;P&gt;Hi, I was trying to calculate a value using the information of 2 columns, I know that it needs to implement a python elif and function. But I don't know how to make it works. Here is my code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JaniceHau_0-1666805271677.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54487i9BC70217CB1D294A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JaniceHau_0-1666805271677.png" alt="JaniceHau_0-1666805271677.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code block:&lt;BR /&gt;def Resistance(x, y):&lt;BR /&gt;if x == "water":&lt;BR /&gt;return 100&lt;BR /&gt;elif x == "barrier":&lt;BR /&gt;return 100&lt;BR /&gt;elif x == "linear_feature" and y == "corridor" or y == "raceway" or y == "elevator":&lt;BR /&gt;return 100&lt;BR /&gt;elif x == "linear_feature" and y == "footway" or y == "bridleway" or y == "track" or y =="path", or y == "proposed" or y == "abandoned" or y == "rest area":&lt;BR /&gt;return 20&lt;BR /&gt;elif x == "linear_feature" and y == "motorway" or y == "motorway_link" or y == "trunk" or y == "trunk_link" or y == "escape" or y == "construction" or y == "turning loop":&lt;BR /&gt;return 70&lt;BR /&gt;elif x == "linear_feature" and y == "primary" or y == "secondary" or y == "tertiary" or y == "primary_link" or y =="secondary_link" or y == "tertiary_link" or y == "unclassified" or y == "road":&lt;BR /&gt;return 50&lt;BR /&gt;elif x == "linear_feature" and y == "residential" or y == "cycleway" or y == "living street" or y == "platform" or y =="bustop"&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "linear_feature" and y == "services" or y == "pedestrain" or y == "crossing" or y == "steps"&lt;BR /&gt;return 20&lt;BR /&gt;elif x == "residential":&lt;BR /&gt;return 40&lt;BR /&gt;elif x == "institutional":&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "open_green_area":&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "hetero_green_area":&lt;BR /&gt;return 30&lt;BR /&gt;elif x == "dense_green_area":&lt;BR /&gt;return 20&lt;BR /&gt;elif x == "resourceful_green_area":&lt;BR /&gt;return 10&lt;BR /&gt;elif x == "building":&lt;BR /&gt;return 100&lt;BR /&gt;else:&lt;BR /&gt;return 0&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 17:28:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculation-trying-to-define-a-value-with/m-p/1225765#M61586</guid>
      <dc:creator>JaniceHau</dc:creator>
      <dc:date>2022-10-26T17:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculation: trying to define a value with the information of 2 columns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculation-trying-to-define-a-value-with/m-p/1225802#M61590</link>
      <description>&lt;P&gt;The syntax is:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Resistance(!feature!, !type!)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Oct 2022 18:18:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculation-trying-to-define-a-value-with/m-p/1225802#M61590</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2022-10-26T18:18:48Z</dc:date>
    </item>
  </channel>
</rss>

