-2

How do I convert SRID 3857 formatted geometery coordinates into to decimal degrees?

My current stack is SQL Server 2014 and C#.

Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
  • Do you just need to convert it to WGS84? – zerkms Jun 18 '14 at 00:11
  • I need it to be in a format that http://leafletjs.com/ understands. – Jonathan Allen Jun 18 '14 at 00:37
  • So what projection and format it understands? – zerkms Jun 18 '14 at 00:37
  • Decimal degrees. I'm not seeing anything in the documentation more specific than that. – Jonathan Allen Jun 18 '14 at 00:40
  • Well, seems like it's what I mentioned in the first comment. Just convert it to WGS84 and see if it points to a correct location – zerkms Jun 18 '14 at 00:44
  • How do I do that given my data is currently in a SqlGeometry column? – Jonathan Allen Jun 18 '14 at 00:45
  • Tried searching "sql server convert to wgs84" in google? – zerkms Jun 18 '14 at 00:48
  • 1
    Yes. Mostly I run into comments such as "Coordinate transformation on ellipsoidal-based planar coordinates is beyond the scope of the SQL Server Spatial Tools project (the projection functions in this project are all based on a spherical Earth definition which is not suitable for this class of problem). The specific case of WGS84 UTM coordinates falls into this category." – Jonathan Allen Jun 18 '14 at 00:55
  • possible duplicate of [Convert coordinate systems using SQLGeometery](http://stackoverflow.com/questions/24274136/convert-coordinate-systems-using-sqlgeometery) – Jonathan Allen Jun 19 '14 at 03:29
  • See http://stackoverflow.com/questions/24274136/convert-coordinate-systems-using-sqlgeometery/24298296#24298296 SRID 4236 seems to work well enough. – Jonathan Allen Jun 19 '14 at 03:33

2 Answers2

1

You cannot convert them directly in SQL Server. Quite simply it wasn't built to reinvent the Reprojection of spatial data in one datum to another. When using SqlGeography, you can of course swap between SRIDs when both sets of coordinates use the same coordinate-type (decimal-degrees or grid-based), however when using SqlGeometry, they are simply planar coordinates based on the scale set by the bounds of the data you have and setting the SRID merely "groups" like-SRID spatial objects.

You'll need a Third-Party library or tool to do this for you. Geographika notes some options at the following SO Link:

Know of any C# spatial data libraries?

Community
  • 1
  • 1
Jon Bellamy
  • 3,333
  • 20
  • 23
0

See Convert coordinate systems using SQLGeometery

SRID 4326 seems to work well enough.

http://spatialreference.org/ref/epsg/4326/

Community
  • 1
  • 1
Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447