<?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: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150144#M52284</link>
    <description>&lt;P&gt;For simple adjustments, you can also convert the original geometry to a dictionary and manipulate it.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var pt = Point({
    x: 40,
    y: 12,
    spatialReference: {
        wkid: 102100
    }
})

var pt_json = Dictionary(Text(pt))

pt_json['x'] = 20

// returns 20
return Point(pt_json)['x']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you wanted, you could even develop your own custom functions around this idea:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function Translate(in_point, x_shift, y_shift){
    var pt_json = Dictionary(Text(in_point))

    pt_json['x'] += x_shift
    pt_json['y'] += y_shift

    return Point(pt_json)
}

var test_point = Point({x: 40, y: 12, spatialReference: {wkid: 102100}})

return Translate(test_point, -10, 5)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1646313247241.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35481iA7B4502703E00718/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1646313247241.png" alt="jcarlson_1-1646313247241.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But that doesn't change the answer that no, you can't manipulate geometry objects &lt;EM&gt;in place&lt;/EM&gt;, only while converting to another object, or overwriting the entire variable with a new object.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 13:14:50 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-03-03T13:14:50Z</dc:date>
    <item>
      <title>Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150084#M52277</link>
      <description>&lt;P&gt;If I understand correctly, the Arcade Geometry type has subtypes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Point&lt;/LI&gt;&lt;LI&gt;Multipoint&lt;/LI&gt;&lt;LI&gt;Polyline&lt;/LI&gt;&lt;LI&gt;Polygon&lt;/LI&gt;&lt;LI&gt;Extent&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Question:&lt;BR /&gt;Are those subtypes immutable, since the Geometry supertype is immutable?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/guide/types/#:~:text=Extent.%20Geometry%20is-,immutable,-%2C%20meaning%20it%20is" target="_self"&gt;Geometry is immutable&lt;/A&gt;, meaning it is not possible to change the geometry after it is created.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For example, if I assign a value to a point, does that mean that geometry can't be changed?&lt;/P&gt;&lt;PRE&gt;var pt = Point({ 'x': 100, 'y': 100, 'spatialReference':{'wkid':102100} });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:08:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150084#M52277</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-03-03T14:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150097#M52278</link>
      <description>&lt;P&gt;In my experience, yes.&lt;/P&gt;&lt;P&gt;For example, you can't do something like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var pt = Point({ 'x': 100, 'y': 100, 'spatialReference':{'wkid':102100} });
Console(pt)
// attempt to change x coordinate
// this will fail
pt.x += 5
Console(pt)&lt;/LI-CODE&gt;&lt;P&gt;"Immutable" just means "This object and its values can not be changed".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To work around it, you have to make a copy of the geometry's values, change them and then create a new geometry with these changed values:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var pt = Point({ 'x': 100, 'y': 100, 'spatialReference':{'wkid':102100} });
Console(pt)
// attempt to change x coordinate
//pt.x += 5
var new_pt = Point({'x': pt.x + 5, 'y': pt.y, 'spatialReference': pt.spatialReference})
Console(new_pt)

// you could also extract the geometry's dictionary and change the values there:
var pt_dict = Dictionary(Text(pt))
pt_dict.y += 5
var new_pt_2 = Point(pt_dict)
Console(new_pt_2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To change the geometry of polylines or polygons, you have to take it a step further: you have to recreate the paths/rings.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var old_path = Geometry($feature).paths[0]
var sr = Geometry($feature).spatialReference

var new_path = []
for(var i in old_path) {
    // move vertext to north east and remove digits, because why not?
    var new_vert = Point({'x': Round(old_path[i].x) + 100, 'y': Round(old_path[i].y) + 100, 'spatialReference': sr})
    Push(new_path, new_vert)
}
var new_geo = Polyline({'paths': [new_path], 'spatialReference': sr})

Console(Geometry($feature))
Console(new_geo)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Mar 2022 08:29:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150097#M52278</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-03-03T08:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150144#M52284</link>
      <description>&lt;P&gt;For simple adjustments, you can also convert the original geometry to a dictionary and manipulate it.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var pt = Point({
    x: 40,
    y: 12,
    spatialReference: {
        wkid: 102100
    }
})

var pt_json = Dictionary(Text(pt))

pt_json['x'] = 20

// returns 20
return Point(pt_json)['x']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you wanted, you could even develop your own custom functions around this idea:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function Translate(in_point, x_shift, y_shift){
    var pt_json = Dictionary(Text(in_point))

    pt_json['x'] += x_shift
    pt_json['y'] += y_shift

    return Point(pt_json)
}

var test_point = Point({x: 40, y: 12, spatialReference: {wkid: 102100}})

return Translate(test_point, -10, 5)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1646313247241.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35481iA7B4502703E00718/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1646313247241.png" alt="jcarlson_1-1646313247241.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But that doesn't change the answer that no, you can't manipulate geometry objects &lt;EM&gt;in place&lt;/EM&gt;, only while converting to another object, or overwriting the entire variable with a new object.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 13:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150144#M52284</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-03T13:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150159#M52287</link>
      <description>&lt;P&gt;Side question:&lt;/P&gt;&lt;P&gt;In your post, it looks like you are sending an output to the console().&lt;/P&gt;&lt;P&gt;Out of curiosity, what are you doing there? Where are you displaying that value?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 07:33:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150159#M52287</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-03-06T07:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150170#M52289</link>
      <description>&lt;P&gt;The console is more for debugging or checking on things. Useful for longer, more complex expressions, but you can only see those messages in the Expression Builder interface, such as in AGOL.&lt;/P&gt;&lt;P&gt;When you test an expression, you can see there are the &lt;STRONG&gt;results&lt;/STRONG&gt; and the &lt;STRONG&gt;messages&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1646317245167.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35486i50C5575658E82101/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1646317245167.png" alt="jcarlson_0-1646317245167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1646317272761.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35487i87F573FC64EA7C5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1646317272761.png" alt="jcarlson_1-1646317272761.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:21:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150170#M52289</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-03T14:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150176#M52291</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;but you can only see those messages in the Expression Builder interface, such as in AGOL&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I recently learned that you can also see them in Pro:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Verify the expression, then you can click on the button.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1646318110371.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35488i1942AA91C1B8B0A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1646318110371.png" alt="JohannesLindner_0-1646318110371.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1646318122213.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35489i4D92357A95D8594E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1646318122213.png" alt="JohannesLindner_1-1646318122213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:35:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150176#M52291</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-03-03T14:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150180#M52292</link>
      <description>&lt;P&gt;🤯&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:44:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150180#M52292</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-03T14:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Are Arcade geometry subtypes immutable? (i.e. point, polyline, polygon)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150192#M52295</link>
      <description>&lt;P&gt;I found this post just now, which confirms what&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;mentioned.&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/where-do-the-arcade-console-messages-go-to/m-p/1125076/highlight/true#M48931" target="_self"&gt;Where do the Arcade Console messages go to?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 15:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/are-arcade-geometry-subtypes-immutable-i-e-point/m-p/1150192#M52295</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-03-03T15:10:13Z</dc:date>
    </item>
  </channel>
</rss>

