<?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 Arcade modify only Z geometry in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1364723#M1225</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;In the exemple below, i can create another point with the Z coordinate of the field "Z_OUV" in stead of the original Z coordinate. But is it possible to modify the current point and not create another one?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if ($feature.Z_OUV == Geometry($feature).z) {
  return
};

var newGeom = Point({
  hasZ: true,
  x: Geometry($feature).x,
  y: Geometry($feature).y,
  z: $feature.Z_OUV,
  spatialReference: { wkid: 4326 }
});

var featureID = $feature.OBJECTID;
var f = filter(FeatureSetByName($datastore, "WaterDevice"), "OBJECTID = @featureID");
if (count(f) == 0) return $feature.Z_OUV;
var featureAct = first(f);

return {
  "result": $feature.Z_OUV,
  "edit": [{  
    "className" : "WaterDevice",
    "updates" : [
      { 
      "OBJECTID": featureAct.OBJECTID,
      "geometry": newGeom
      }
    ]}
]}&lt;/LI-CODE&gt;&lt;P&gt;I tried to just update the "z" in the geometry section, but was met with an error. Is there a way to just modify one coordinate?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;"geometry": {"z": $feature.Z_OUV}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Dec 2023 14:34:09 GMT</pubDate>
    <dc:creator>FlorentChalvet</dc:creator>
    <dc:date>2023-12-28T14:34:09Z</dc:date>
    <item>
      <title>Arcade modify only Z geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1364723#M1225</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;In the exemple below, i can create another point with the Z coordinate of the field "Z_OUV" in stead of the original Z coordinate. But is it possible to modify the current point and not create another one?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if ($feature.Z_OUV == Geometry($feature).z) {
  return
};

var newGeom = Point({
  hasZ: true,
  x: Geometry($feature).x,
  y: Geometry($feature).y,
  z: $feature.Z_OUV,
  spatialReference: { wkid: 4326 }
});

var featureID = $feature.OBJECTID;
var f = filter(FeatureSetByName($datastore, "WaterDevice"), "OBJECTID = @featureID");
if (count(f) == 0) return $feature.Z_OUV;
var featureAct = first(f);

return {
  "result": $feature.Z_OUV,
  "edit": [{  
    "className" : "WaterDevice",
    "updates" : [
      { 
      "OBJECTID": featureAct.OBJECTID,
      "geometry": newGeom
      }
    ]}
]}&lt;/LI-CODE&gt;&lt;P&gt;I tried to just update the "z" in the geometry section, but was met with an error. Is there a way to just modify one coordinate?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;"geometry": {"z": $feature.Z_OUV}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 14:34:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1364723#M1225</guid>
      <dc:creator>FlorentChalvet</dc:creator>
      <dc:date>2023-12-28T14:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade modify only Z geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1364949#M1226</link>
      <description>&lt;P&gt;I remember trying something similar a while back, but I wanted to change the M-values of lines. I’m too rusty to help at this point, but you could check out my old M-value posts:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcade-code-review-set-polyline-m-values-to/m-p/1153012" target="_self"&gt;Arcade Code Review: Set polyline M-values to cumulative length of line&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/arcade-docs-working-with-vertices/idi-p/1152038" target="_self"&gt;Arcade docs: Working with vertices&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 02 Jan 2024 17:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1364949#M1226</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-02T17:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade modify only Z geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1365442#M1227</link>
      <description>&lt;P&gt;You need to pass back a complete geometry object.&amp;nbsp; So copy your geoemtry(can do this by calling Dictionary(geo) on it, prior to 3.2, you need to call Dictionary(Text(geo))).&amp;nbsp; Modify the Z and then pass that dict into the geometry constructor.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 17:07:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1365442#M1227</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-01-02T17:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade modify only Z geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1366171#M1230</link>
      <description>&lt;P&gt;Hey!&lt;/P&gt;&lt;P&gt;Thanks for the reply. I've checked your old posts, and there was the explanation for why it didn't work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FlorentChalvet_0-1704358075979.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/90485i315DC1D28A160AFA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FlorentChalvet_0-1704358075979.png" alt="FlorentChalvet_0-1704358075979.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If geometries are immutable, then I don't think I can modify only one attribute of the geometry...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 08:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1366171#M1230</guid>
      <dc:creator>FlorentChalvet</dc:creator>
      <dc:date>2024-01-04T08:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade modify only Z geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1366173#M1231</link>
      <description>&lt;P&gt;Hey! I'm on 2.8 right now. Working with a Dictionary is doable, but I still create a new geometry who has the exact same attributes as the first one instead of modifying the current one.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var newGeom = Dictionary(Text(Geometry($feature)))
newGeom['z'] = $feature.Z_OUV
newGeom['hasZ'] = true
var testGeom = Geometry(newGeom)&lt;/LI-CODE&gt;&lt;P&gt;I also needed to add a 'hasZ' attribute to the dictionary for it to create a valid geometry.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 08:58:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-modify-only-z-geometry/m-p/1366173#M1231</guid>
      <dc:creator>FlorentChalvet</dc:creator>
      <dc:date>2024-01-04T08:58:38Z</dc:date>
    </item>
  </channel>
</rss>

