<?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 - Search Geometry Cannot Be Null error in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1625458#M96784</link>
    <description>&lt;P&gt;I found that the version of ArcGIS Pro that I use in our AWS Cloud environment, which is a few versions behind, may have been throwing the error because of a bug.&amp;nbsp; When I tested on the latest version on my PC, I didn't receive it, but I was getting bad results.&amp;nbsp; It was matching neighborhoods to road centerlines that were several miles away.&amp;nbsp; I contacted Esri support and they were able to modify the script to make it work:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var fsNbrhd = FeatureSetByName($datastore, "Neighborhood", ['Nbrhd_Comm'], true)&lt;BR /&gt;var fsNbrhdRight = Intersects(fsNbrhd, $feature)&lt;BR /&gt;if (Count(fsNbrhdRight) &amp;gt; 0) {&lt;BR /&gt;var NbrhdRight = First(fsNbrhdRight)&lt;BR /&gt;return NbrhdRight.Nbrhd_Comm&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;var buffLine = Offset($feature, 200, 'us-feet')&lt;BR /&gt;var NewInterSect = Intersects(fsNbrhd, buffLine)&lt;BR /&gt;if(Count(NewInterSect) &amp;gt; 0) {&lt;BR /&gt;return First(NewInterSect).Nbrhd_Comm&lt;BR /&gt;}&lt;BR /&gt;else return null&lt;BR /&gt;&lt;BR /&gt;}&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Jun 2025 19:37:53 GMT</pubDate>
    <dc:creator>JoshSaad1</dc:creator>
    <dc:date>2025-06-20T19:37:53Z</dc:date>
    <item>
      <title>Arcade - Search Geometry Cannot Be Null error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1622623#M96513</link>
      <description>&lt;P&gt;In my road centerline features I'm trying to calculate the neighborhood names in the left and right sides of each road segment based on the neighborhood.&amp;nbsp; To indicate which side to check, I'm including an Offset function to calculate the neighborhood name that intersects 1-foot on either side of the line.&amp;nbsp; I'm also performing this in a file geodatabase.&amp;nbsp; Here is my script:&lt;/P&gt;&lt;PRE&gt;var fsNbrhd = FeatureSetByName($datastore, 'Neighborhood', ['Nbrhd_Comm'], true)&lt;BR /&gt;var RoadLeft = Offset($feature, -1, 'us-feet', 'square')&lt;BR /&gt;var fsNbrhdLeft = Intersects(fsNbrhd, RoadLeft)&lt;BR /&gt;var NbrhdLeft = First(fsNbrhdLeft)&lt;BR /&gt;&lt;BR /&gt;if (IsEmpty(Geometry(NbrhdLeft))) return&lt;BR /&gt;else if(NbrhdLeft == null) return null&lt;BR /&gt;else return NbrhdLeft.Nbrhd_Comm&lt;/PRE&gt;&lt;P&gt;I keep getting an error on line 4, "Search geometry cannot be null".&amp;nbsp; However, if I change the variable on line 3 to the line itself instead of the offset:&lt;/P&gt;&lt;PRE&gt;var fsNbrhdLeft = Intersects(fsNbrhd, $feature) &lt;/PRE&gt;&lt;P&gt;I don't get the error, and it just calculates whatever polygon my line intersects.&amp;nbsp; I think the problem might be with the Offset function.&lt;/P&gt;&lt;P&gt;I also tried adding error messages in the script to help identify the problem:&lt;/P&gt;&lt;PRE&gt;var fsNbrhd = FeatureSetByName($datastore, 'Neighborhood', ['Nbrhd_Comm'], true)&lt;BR /&gt;if (IsEmpty(Geometry(fsNbrhd))) return "error0"&lt;BR /&gt;&lt;BR /&gt;var RoadLeft = Offset($feature, -1, 'us-feet', 'square')&lt;BR /&gt;if (IsEmpty(Geometry(RoadLeft))) return "error1"&lt;BR /&gt;&lt;BR /&gt;var fsNbrhdLeft = Intersects(fsNbrhd, RoadLeft)&lt;BR /&gt;if (IsEmpty(Geometry(fsNbrhdLeft))) return "error2"&lt;BR /&gt;&lt;BR /&gt;var NbrhdLeft = First(fsNbrhdLeft)&lt;BR /&gt;if (IsEmpty(Geometry(NbrhdLeft))) return "error3"&lt;BR /&gt;&lt;BR /&gt;if(NbrhdLeft == null) return null&lt;BR /&gt;return NbrhdLeft.Nbrhd_Comm&lt;/PRE&gt;&lt;P&gt;When running this, all of the features returned "error0", indicating null geometry in my Neighborhood layer, but it seems to be drawing on the map with no problem, and it calculates fine if I ignore the offset and just calculate whatever intersects the line.&lt;/P&gt;&lt;P&gt;Has anyone else experienced this, or can help identify the problem?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 14:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1622623#M96513</guid>
      <dc:creator>JoshSaad1</dc:creator>
      <dc:date>2025-06-11T14:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Search Geometry Cannot Be Null error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1622642#M96514</link>
      <description>&lt;P&gt;What do you get when you return&amp;nbsp;RoadLeft? Your code seems to work in the Playground, returning the value for the IsEmpty check. That is expected, since I doubt the testing FeatureSet and $feature intersect at all&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_8068ae.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/134203i2F3ABCCF4B7FA117/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_8068ae.png" alt="Snag_8068ae.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The reason you're getting "error0" is that the Geometry function expects a Feature, not a FeatureSet.&amp;nbsp; You'd have to loop through the FeatureSet to test each Feature.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fsNbrhd =  FeatureSetByName($datastore, 'Neighborhood', ['Nbrhd_Comm'], true);
for (var f in fsNbrhd) {
  if (IsEmpty(Geometry(f))) return `Record ${f.OJBECTID) is empty";
}
return "No empty records";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;What's curious is that putting the FeatureSet in the Geometry function works in ArcGIS Pro but not in the Playground.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_9a4dc5.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/134206iCAF021A88E264ACB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_9a4dc5.png" alt="Snag_9a4dc5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;**Update&lt;/P&gt;&lt;P&gt;I did test your code using my data in ArcGIS Pro and it did run correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 15:00:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1622642#M96514</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-06-11T15:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Search Geometry Cannot Be Null error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1623946#M96670</link>
      <description>&lt;P&gt;I'm still testing out some things.&amp;nbsp; I tried the script you suggested, looping through all of the features, but got "No Empty Records" for all of my features.&lt;/P&gt;&lt;P&gt;I put in a support ticket with Esri to see if they can help out.&amp;nbsp; I'll post an answer if I get it working.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 17:36:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1623946#M96670</guid>
      <dc:creator>JoshSaad1</dc:creator>
      <dc:date>2025-06-16T17:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Search Geometry Cannot Be Null error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1625458#M96784</link>
      <description>&lt;P&gt;I found that the version of ArcGIS Pro that I use in our AWS Cloud environment, which is a few versions behind, may have been throwing the error because of a bug.&amp;nbsp; When I tested on the latest version on my PC, I didn't receive it, but I was getting bad results.&amp;nbsp; It was matching neighborhoods to road centerlines that were several miles away.&amp;nbsp; I contacted Esri support and they were able to modify the script to make it work:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var fsNbrhd = FeatureSetByName($datastore, "Neighborhood", ['Nbrhd_Comm'], true)&lt;BR /&gt;var fsNbrhdRight = Intersects(fsNbrhd, $feature)&lt;BR /&gt;if (Count(fsNbrhdRight) &amp;gt; 0) {&lt;BR /&gt;var NbrhdRight = First(fsNbrhdRight)&lt;BR /&gt;return NbrhdRight.Nbrhd_Comm&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;var buffLine = Offset($feature, 200, 'us-feet')&lt;BR /&gt;var NewInterSect = Intersects(fsNbrhd, buffLine)&lt;BR /&gt;if(Count(NewInterSect) &amp;gt; 0) {&lt;BR /&gt;return First(NewInterSect).Nbrhd_Comm&lt;BR /&gt;}&lt;BR /&gt;else return null&lt;BR /&gt;&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Jun 2025 19:37:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-search-geometry-cannot-be-null-error/m-p/1625458#M96784</guid>
      <dc:creator>JoshSaad1</dc:creator>
      <dc:date>2025-06-20T19:37:53Z</dc:date>
    </item>
  </channel>
</rss>

