I'm trying to use a SQL query to get the Lat Long of points in a point layer in our geodatabase. The STAsText method will return the XY as shown below, but I'd like to get the lat long instead. Is there a method that can do this or is there a conversion I could use in SQL to convert the XY from STAsText?
Here is the query to get the XY:
select SHAPE, [SHAPE].STAsText() XY
Any help would be greatly appreciated. Thanks!
SQL Server does also support STX and STY for the geometry type:
In addition, are you looking to convert the Feet units of a Projected Coordinate System to Decimal Degrees?
Sounds good. Just something to keep in mind with conversions here is that SQL Server doesn't have support for a Transform or Reproject function. Is it possible to reproject spatial data using SQL Server?
My intention was to have this live in the database as part of a spatial view without any processing outside the database. I'll likely just use python to extract the view and do the final calculations.