<?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: Arcade - Spatial reference expected in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1637167#M97635</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/135406"&gt;@aricraimundo&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Does "commonGeometry"&amp;nbsp; have a coordinate system once it has been created from the intersect?&lt;BR /&gt;I don't know Arcade very well and it is full of weird things.&lt;BR /&gt;Try assigning a coordsys prior to the area calc.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jul 2025 00:43:04 GMT</pubDate>
    <dc:creator>RTPL_AU</dc:creator>
    <dc:date>2025-07-29T00:43:04Z</dc:date>
    <item>
      <title>Arcade - Spatial reference expected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1637137#M97632</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm working with an Arcade expression in ArcGIS Pro Advanced 3.5.2 on Windows 11, using a File Geodatabase (v10.0).&lt;/P&gt;&lt;P&gt;I'm trying to create an immediate calculation attribute rule triggered on Insert or Update of a polygon feature class. The rule is intended to extract two fields (FIELD1 and FIELD2) from another polygon feature class based on maximum area of intersection.&lt;BR /&gt;&lt;BR /&gt;Both of my polygon feature classes have defined spatial references, so I don't believe it's a projection issue.&amp;nbsp;However, when I attempt to calculate the area of the intersection geometry (&lt;STRONG&gt;line 25&lt;/STRONG&gt;), I get this error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Arcade error: Spatial reference expected.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here is my expression:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fc = FeatureSetByName(
  $datastore,
  "MyPolygonFeatureClass",
  ["FIELD1", "FIELD2"],
  true
);

var matches = Intersects(fc, $feature);
var matchesCount = Count(matches);

if (matchesCount == 0) {
  return { errorMessage: "Invalid feature !" };
}

var feat = null;

if (matchesCount == 1) {
  feat = First(matches);
} else {
  var bestMatch = null;
  var maxArea = 0.0;

  for (var f in matches) {
    var commonGeometry = Intersection($feature, f);
    var geometryArea = AreaGeodetic(commonGeometry, "square-meters");

    if (IsEmpty(bestMatch) || geometryArea &amp;gt; maxArea) {
      maxArea = geometryArea;
      bestMatch = f;
    }
  }

  feat = bestMatch;
}

return {
  result: {
    attributes: {
      field1: feat.FIELD1,
      field2: feat.FIELD2,
    },
  },
};&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I've reviewed my Arcade expression and can't spot any obvious issue.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I also came across &lt;A href="https://support.esri.com/pt-br/bug/an-arcade-expression-functions-correctly-in-arcgis-pro-bug-000176749" target="_self"&gt;BUG-000176749&lt;/A&gt;, and I'm wondering if this might be related.&lt;/P&gt;&lt;P&gt;Has anyone else encountered this error or have insight into what might be causing it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 21:49:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1637137#M97632</guid>
      <dc:creator>aricraimundo</dc:creator>
      <dc:date>2025-07-28T21:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Spatial reference expected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1637167#M97635</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/135406"&gt;@aricraimundo&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Does "commonGeometry"&amp;nbsp; have a coordinate system once it has been created from the intersect?&lt;BR /&gt;I don't know Arcade very well and it is full of weird things.&lt;BR /&gt;Try assigning a coordsys prior to the area calc.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 00:43:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1637167#M97635</guid>
      <dc:creator>RTPL_AU</dc:creator>
      <dc:date>2025-07-29T00:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Spatial reference expected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1637172#M97636</link>
      <description>&lt;P&gt;Yes, it does.&lt;/P&gt;&lt;P&gt;And commonGeometry is a Polygon. I’ve used TypeOf to confirm.&lt;/P&gt;&lt;P&gt;I agree with you on “weird things”.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 01:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1637172#M97636</guid>
      <dc:creator>aricraimundo</dc:creator>
      <dc:date>2025-07-29T01:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Spatial reference expected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1658279#M99574</link>
      <description>&lt;P&gt;Did you find a solution or work around. We recently upgraded our environment and now our previously working attribute rules stopped working with the same error. Ours are almost identical to yours. They return a field from an intersecting polygon feature class and returns the value from the feature of greatest overlap.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 22:21:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1658279#M99574</guid>
      <dc:creator>AlexisHandelman</dc:creator>
      <dc:date>2025-10-15T22:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Spatial reference expected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1660432#M99738</link>
      <description>&lt;P&gt;I have just been testing using ArcGIS 3.5.4 to ugrade within our team and immediatly stumbled into this issue getting the &lt;STRONG&gt;Arcade error: Spatial reference expected.&lt;/STRONG&gt; on an arcade field calculation.&amp;nbsp; I managed to get it to work on 3.4 but not in 3.5.4 giving the same error.&amp;nbsp; The line of code it failed on was this:&lt;/P&gt;&lt;P&gt;intersectArea += Area(intersection($feature,block), "square metres");&lt;/P&gt;&lt;P&gt;Would be good to know if this is fixed so we can trust an upgrade?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 12:13:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1660432#M99738</guid>
      <dc:creator>JoeNunn</dc:creator>
      <dc:date>2025-10-24T12:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Spatial reference expected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1670558#M100595</link>
      <description>&lt;P&gt;I'm experiencing the same thing with Pro 3.5.4 too. Very frustrating.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 17:11:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-spatial-reference-expected/m-p/1670558#M100595</guid>
      <dc:creator>Juan_Toro-Killion</dc:creator>
      <dc:date>2025-12-04T17:11:42Z</dc:date>
    </item>
  </channel>
</rss>

