Select to view content in your preferred language

Intersect Attribute Rule Failing when Splitting Existing Features "Invalid search geometry"

1678
8
02-17-2022 05:31 AM
RexRobichaux
Occasional Contributor

Hello everyone, 

 

We had a series of attribute rules built out for our editors the methodically produce a unique permit specific ID field. One of the first attribute rules retrieves the county/locality FIPS code for a polygon feature upon create/insert, as this is used in the unique ID field. This works fine when drawing/creating a new record. However, I'm getting an ambiguous "Invalid search geometry" arcade error when trying to split an existing polygon feature in ArcGIS Pro. 

Environment: 

  • ArcGIS Pro 2.9.x
  • Geodatabase: Oracle 19c
  • Editing through editable 10.7.1 feature service - unfederated server. 

 

Here's a screenshot of the error upon trying a split:

RexRobichaux_0-1645104164799.png

The offending attribute rule's properties: 

RexRobichaux_1-1645104209252.png

 

It seems as though the problematic line below would indicate Pro isn't passing the "new" split feature as the search_feature / $feature into the following line properly...or I might very well be completely misunderstanding how splits are handled in the Pro client and sent to the geodatabase for evaluation. 

var search_feature = $feature;

var intersected_feature = First(Intersects(intersecting_featset, search_feature));

 

 

 

 

// This rule will populate the edited features field with a value from an intersecting feature

// Value to copy from the intersected feature
var intersecting_field = "FIPS";

//Field rule is assigned to in the Attribute Rule
var feature_field = $feature.FIPS;

// Create feature set to the intersecting class using the GDB Name
var intersecting_featset = FeatureSetByName($datastore, 'GIS_DBA.VA_COUNTY_BOUNDARY_STG', [intersecting_field], true);

var search_feature = $feature;

var intersected_feature = First(Intersects(intersecting_featset, search_feature));

// Check to make sure there was an intersected feature, if not, return the original value
if (intersected_feature == null)

{
    return $feature.FIPS;
}

// If the intersected feature is null, return the original value
if (IsEmpty(intersected_feature[intersecting_field]))

{
    return $feature.FIPS;
}

// Return the intersected features value
return '51'+intersected_feature[intersecting_field];

 

 

 

 

 

I'd love to hear any ideas anyone might have on this one and why this rule can't seem to properly interpret the split feature.  @HusseinNasser2  and anyone else- thanks for any help and ideas you might have!

 

-Rex

 

8 Replies
KimGarbade
Regular Contributor

You know.... I used your code (had to change some names of course) on some sample data and it works like a charm.  I've tried to break it by disabling the script from running on "Update" (which at first I thought was the problem - its not) and by setting "Exclude from application evaluation" (even though not sure it would matter in this case) and it just keeps working.  The one time it didn't work was when I had an error in the polygon geometry I was splitting.... So maybe your problem isn't the script but the data it uses.

As an FYI and probably apropos of nothing:   I didn't set a variable named "intersecting_field" so, for example, my script used "return '51'+intersected_feature.FIPS;"... but like I said, can't see why that would make any difference at all.

RexRobichaux
Occasional Contributor

Thanks for testing it out Kim! That is interesting. Agreed- I can't see anything that you changed that would have impacted the functionality of the rule vs what I've been trying. I might try moving it local to a FGDB and testing a split there as well. 

 

I tried this on other geometries today and still got the same error. Even tried it in other localities / areas but got the same behavior. Merging works fine, creating new features and updating existing ones works just fine, but it just doesn't seem to like the split on my end. Very weird- thanks again for testing this out and posting your results.

0 Kudos
KimGarbade
Regular Contributor

I did test in a file GDB. I'm also using 2.8.5 (had to downgrade... long story).  Hope it works out for you since I really wanted to solve this one but I found nothing to solve and I hate mysteries.  One last hail marry might be I notice your feature class name in the FeaturesetByName function is not fully qualified. By that I mean it's usually databasename.dataowner.featureclassname. but in the code above I just see dataowner.featureclassname. try fully qualifying it by adding the database name. Since I tested in a file GDB I didn't have to do that so maybe that's why it worked. Maybe....but your code tests for null sets and values so....

0 Kudos
RexRobichaux
Occasional Contributor

Hey Kim- thanks again for your time and thoughts on this. I ported everything back to a file GDB this AM and sure enough...the split works fine. Now I'm really perplexed. I'll play around a little bit more in the enterprise gdb environment but unless it's something weird like the fully qualified name (which I wouldn't think would be needed since it can create new features just fine, as well as merge)... I might be off to Esri Support. Thanks again for your help with this!

0 Kudos
RexRobichaux
Occasional Contributor

Just a quick update for anyone following or curious... I've opened up a case with Esri Support Services who are looking into it. While waiting, I performed another test of performing the split from ArcGIS Pro while directly connected to the enterprise geodatabase via direct database connection vs through the feature service, and the split works. Too early to say for sure, but this is looking like it might be an isolated issue related to the editing/splitting through the feature service with the attribute rules. I'll post an update once more is known. 

SkógræktarfélagEyfirðinga
New Contributor

Hi

I'm very curious for a solution to this problem. Have you had any news from Esri Support Services?

Thanks

0 Kudos
RexRobichaux
Occasional Contributor

I'm afraid I don't have great news. My case with Esri ended up being logged to a couple (really the same) bug (information below). The good news is that the edit errors only occur (at least for us) when splitting features, and only when there was an attribute rule performing a background intersect. Other attribute rules and tools had no issues. It's also specific to ArcGIS Server feature services as the issue is not reproducible when editing even an enterprise geodatabase feature class through a direct geodatabase connection in Pro. 

 

BUG-000149644 : Modifying features fails when editing feature layers that have attribute rules using Arcade expression in ArcGIS Pro.

BUG-000131981 : Modifying features fails when editing feature layers that have attribute rules using Arcade expression in ArcGIS Pro 2.5.

 

Our workaround (not ideal) is to give direct geodatabase connections to the few editors needing to perform splits for the time being while everyone else will edit through the feature service in ArcGIS Pro. 

0 Kudos
MatejKucek
New Contributor

Hi,

I am currently facing same issue but what I found out is that when I put whole $feature in log geometry is empty (when using split through feature service's layer):

"geometry": {
"rings": [],
"spatialReference": {
"wkid": 8353
}
}

However when I try split on layer directly connected through DB, geometry is valid:

"geometry": {
"rings": [[
[1902401.6964000016, 6138952.3034999967, 0],
[1899403.0103, 6138866.9371, 0],
[1899283.3171, 6143071.4283, 0],
[1901957.1263, 6143147.546099998, 0],
[1902401.6964000016, 6138952.3034999967, 0]]],
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
}
},

 

0 Kudos