Differences in coords for point between REST and SQL Server

1670
13
10-08-2018 10:31 AM
EvelynHernandez
Occasional Contributor III

Hello everybody,

I am having some issue when i try to get the X, Y from a SHAPE saved in a sql server database.

For example, in the rest service, in a layer of points i have the following data saved for a point:

REST SERVICE:

# records: 1

OBJECTID: 41602
Point:
X: -7932483.373700001 
Y: -3897037.876665604 

If i try to get the same point (oid 41602) from a SQL Database using this sentence:

SELECT SHAPE.STY AS LAT, SHAPE.STX AS LON FROM MYTABLE
WHERE OBJECTID = 41602

I got this result

How u can see, the X coord is the same, but the Y coor is not.

Why am i getting this difference? How can i fix it to get the same as the REST service but in my sql server?

Thanks in advice!

0 Kudos
13 Replies
EvelynHernandez
Occasional Contributor III

OK. So how can i know if there is a difference between the rest and my geodatabase due to spatial reference?

I want to make it the same as my REST.

In my rest i have the following:

Spatial Reference: 102100  (3857) 

0 Kudos
JacobSnyder1
Esri Contributor

Hi Evelyn,

WKID 102100 (3857) is associated with the "WGS 1984 Web Mercator (Auxiliary Sphere)" projected coordinate system.

One method that you can use to check on the spatial reference of the data that is located within your Enterprise Geodatabase would be to add the data as a layer to either to an ArcMap MXD file or to an ArcGIS Pro Map. You could then go into the "Properties" of that layer in ArcMap or ArcGIS Pro, and find the spatial reference of the underlying data in the "Source" tab of the layer properties. Compare the spatial reference of the underlying data, to that of the spatial reference found in the REST service.

Thank you,

Jacob

0 Kudos
EvelynHernandez
Occasional Contributor III

Ok. Is there a way to change the spatial reference via DB instead of doing it on the rest? Cuz right now my issue is only with the DB, not the rest service.

El 09-10-2018 12:05, Jacob Snyder <geonet@esri.com> escribió:

GeoNet <https://community.esri.com/?et=watches.email.thread>

Re: Differences in coords for point between REST and SQL Server

reply from Jacob Snyder<https://community.esri.com/people/JSnyder-esristaff?et=watches.email.thread> in ArcGIS API for JavaScript - View the full discussion<https://community.esri.com/message/804928-re-differences-in-coords-for-point-between-rest-and-sql-se...>

0 Kudos
JacobSnyder1
Esri Contributor

Hi Evelyn

If you would like to change the projection of the data in your Enterprise Geodatabase, you could use the "Project" geoprocessing tool. This geoprocessing tool will not alter the projection of the dataset that is used as input to the tool. Rather, it will create a new copy of your dataset that has the desired projection. 

Please see the following document that discusses how you can utilize the "Project" geprocessing tool:

Project—Help | ArcGIS Desktop 

0 Kudos