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

358
1
04-28-2022 03:22 PM
DavidAlfordLPAO
New Contributor

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

0 Kudos
1 Reply
JohannesLindner
MVP Regular 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

JohannesLindner_1-1651223900427.png

 


Have a great day!
Johannes
0 Kudos