Error creating SQL label expression for Shape.STArea() >300000 in ArcGIS Pro

04-28-2022 03:22 PM
New Contributor II

I am trying to recreate a SQL expression in ArcGIS Pro that I have in ArcMap. It is a label expression that was in ArcMap to label the parcel # for parcels with Shape_Area > 300000 in my FGDB. I have migrated my FGDB to SQL and are trying to write the same expression. In SQL the Shape_Area field is now Shape.STArea() will not work with the expression Shape.STArea() >300000.  I can recreate that expression in ArcMap connected to SQL, but not Pro. I am on Pro 2.9.2 and ArcMap 10.9.1

2 Replies
MVP Frequent Contributor

There are 2 ways to do this.


You can have the condition in the Arcade expression:

if($feature.Shape_Area > 300000) {
    return $feature.OBJECTID

// if $feature.Shape_Area doesn't work, you can also try Area($feature)


Or you can have the condition as SQL statement, making the expression very simple:

return $feature.OBJECTID



Have a great day!
0 Kudos
Occasional Contributor II

Did you ever figure out a solution, @DavidAlfordLPAO?

I'm in ArcGIS Pro 3.2.2 and I'm getting the same error message/alert in Notifications.

What's perplexing is that the query is confirmed as "valid" by the label tool, but when you apply it to the label class the error message appears. It has something to do with the "()" I believe, but if it did then why does the validation check say it's okay? So strange.

Also, this exact same expression works perfectly well in the Definition Query and as a regular "Select By Attributes" query. This must be a bug in the labelling stack. I'll call Esri Support and see what I can learn.

0 Kudos