<?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: Creating a centroid Point Feature from a Polygon with attribute rules in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/creating-a-centroid-point-feature-from-a-polygon/m-p/1585414#M93067</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/472241"&gt;@PatrickLösel&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;So the geometry needs to be a point feature, which you can look up in the documentation &lt;A title="point features" href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#point" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. In terms of the code, it might be that there is an inherent syntax issue with part of the code reading as text and not script.&lt;/P&gt;&lt;P&gt;Try writing the code using the point feature that is mentioned and see if that does the trick.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2025 12:09:12 GMT</pubDate>
    <dc:creator>RPGIS</dc:creator>
    <dc:date>2025-02-14T12:09:12Z</dc:date>
    <item>
      <title>Creating a centroid Point Feature from a Polygon with attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/creating-a-centroid-point-feature-from-a-polygon/m-p/1585391#M93062</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am just starting my first attempts with attribute rules and I am still quite inexperienced with ArcGIS Arcade. I came across the following &lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/advanced-gdb-attribute-rules-editing-external-features-with-attribute-rules/" target="_self"&gt;blog post&lt;/A&gt; and tried to recreate it for the automatic creation of a point feature when creating an area feature. However, when checking with the Verify button, I always get the message that there are bracket errors. However, when I try to reproduce my input in Notepad++, I don't understand where the bracket error is specifically.&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;var pointfeature = Centroid($Feature)

return {
        "edit": [
        {
        "className" : "point"
        "adds": [

            {
            "attributes":
                {"polygon_ID" : $feature.GlobalID
                },
            
            "geometry" : pointfeature
            }

                ]
        }
        ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 09:09:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/creating-a-centroid-point-feature-from-a-polygon/m-p/1585391#M93062</guid>
      <dc:creator>PatrickLösel</dc:creator>
      <dc:date>2025-02-14T09:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a centroid Point Feature from a Polygon with attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/creating-a-centroid-point-feature-from-a-polygon/m-p/1585414#M93067</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/472241"&gt;@PatrickLösel&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;So the geometry needs to be a point feature, which you can look up in the documentation &lt;A title="point features" href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#point" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. In terms of the code, it might be that there is an inherent syntax issue with part of the code reading as text and not script.&lt;/P&gt;&lt;P&gt;Try writing the code using the point feature that is mentioned and see if that does the trick.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 12:09:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/creating-a-centroid-point-feature-from-a-polygon/m-p/1585414#M93067</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-02-14T12:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a centroid Point Feature from a Polygon with attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/creating-a-centroid-point-feature-from-a-polygon/m-p/1585435#M93070</link>
      <description>&lt;P&gt;Edit: To avoid this in the future (I make these mistakes all the time) you can paste your arcade script into an editor like VSCode and set the language to JavaScript. It'll find syntax errors for you and even give you quick fix options!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You just missed a comma in your edits dictionary:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var pointfeature = Centroid($Feature)

return {
        "edit": [
            {
                "className" : "point", //Missed a comma here
                "adds": [

                    {
                        "attributes":
                        {
                            "polygon_ID" : $feature.GlobalID
                        },
                        "geometry" : pointfeature
                    }
                ]
            }
        ]
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 20:44:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/creating-a-centroid-point-feature-from-a-polygon/m-p/1585435#M93070</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2025-02-16T20:44:23Z</dc:date>
    </item>
  </channel>
</rss>

