I'm trying to figure out if you can configure a feature class stored in an SQL geodatabase to dynamically update latitude and longitude values based on current locations rather than the last time the values were manually calculated. I found one resource that referenced a Dynamic Update XY and Toggle Automatic Update XY tools, but they seem to be specific to the Aviation solutions in ArcGIS, which we do not use.
Is there a way to configure something very similar to this in the normal ArcMap environment when referencing a point feature class stored in an SQL geodatabase?
Sounds like you may need to create a SQL Server database trigger to complete that task or schedule a Python script to run at a certain interval.
I'll have to look at the SQL triggers. I'm not very server or SQL savvy, so that stuff is beyond my grasp as of right now.
I wasn't real sure what the appropriate location would be. I'll take a look at the link that you provided and move the thread to the Geodatabase group.
CREATE TRIGGER [dbo].[LAT_LON]
after INSERT,UPDATE NOT FOR REPLICATION
SET NOCOUNT ON;
UPDATE p SET
SHAPE = CASE WHEN i.SHAPE IS NOT NULL
THEN p.SHAPE ELSE Geography::STPointFromText('POINT('
+ CAST(p.LON AS VARCHAR(20)) + ' '
+ CAST(p.LAT AS VARCHAR(20)) + ')', 4269) END,
LON = CASE WHEN p.SHAPE IS NULL THEN p.LON ELSE p.SHAPE.Long END,
LAT = CASE WHEN p.SHAPE IS NULL THEN p.LAT ELSE p.SHAPE.Lat END
Abdullah, thank you for this resource. I believe this will be our best option. I'll have to review situations where users "load" data into the feature classes, and in our Online environment, but this will definitely help in our desktop editing environment.