Select to view content in your preferred language

How to skip over a record for update in AR that is null geometry when using Intersects

67
2
Jump to solution
yesterday
LorindaGilbert
Occasional Contributor II

Hi All,

I'm writing attribute rules to take a point and do intersects of different feature classes.  It works fine with the data that are actually points - translated ones or new ones.  My problem is that we have a select few that are just records with no geometry.  This is due to the polygon fc not having the same record to join to (billing location to a parcel and parcel no longer exists so it can't be joined any longer).  I've added the following to my AR to try to just return the value as it exists in the row and keep on going, but get the error message shown.

var fs = FeatureSetByName($datastore,'Parcels_OCPA_Web',["PARCEL"],FALSE);
var interlayer = Intersects(fs, $feature);
var cnt = Count(interlayer);
var billing = $feature.MultiUserType

if (TypeOf($feature) == null) {
ParcelID = $feature.ParcelID
}
else if ((cnt > 0) && (billing != "D: Delete")) {
var interpid = First(interlayer);
return interpid.PARCEL;
}

I have also tried:  if Geometry($feature) == null

or:  if (billing == "D: Delete")

all three return the same error as below

Error is:

Arcade error:  Search geometry cannot be null,

Script line: 3] A null geometry does not correspond to any Esri geometry type.

Any ideas on where to make the changes?  In the future all records moving thru these ARs will be points, it's just the first translation from a flat file to a geo file that is the problem child.

Thanks,

Lorinda

 

0 Kudos
1 Solution

Accepted Solutions
HusseinNasser2
Esri Contributor

Can you try isempty function?

 

ar fs = FeatureSetByName($datastore,'Parcels_OCPA_Web',["PARCEL"],FALSE);

if (isempty(geometry($feature))) return;

var interlayer = Intersects(fs, $feature);
var cnt = Count(interlayer);
var billing = $feature.MultiUserType

if (TypeOf($feature) == null) {
ParcelID = $feature.ParcelID
}
else if ((cnt > 0) && (billing != "D: Delete")) {
var interpid = First(interlayer);
return interpid.PARCEL;
}

 

View solution in original post

0 Kudos
2 Replies
HusseinNasser2
Esri Contributor

Can you try isempty function?

 

ar fs = FeatureSetByName($datastore,'Parcels_OCPA_Web',["PARCEL"],FALSE);

if (isempty(geometry($feature))) return;

var interlayer = Intersects(fs, $feature);
var cnt = Count(interlayer);
var billing = $feature.MultiUserType

if (TypeOf($feature) == null) {
ParcelID = $feature.ParcelID
}
else if ((cnt > 0) && (billing != "D: Delete")) {
var interpid = First(interlayer);
return interpid.PARCEL;
}

 

0 Kudos
LorindaGilbert
Occasional Contributor II

That's what I was missing, and in the wrong order.  Once done on the one field, the next one failed, so then added to the rest of them and all work now.

Thanks!

L~

0 Kudos