3

How I can transform GEOGRAPHY exemplar from one coordinate system to another in MS SQL Server?

For example, I have:

DECLARE @g geography;
SET @g = geography::STGeomFromText('POINT(3 3)', 4326)

How I can transform this GEOGRAPHY to coordinate system with SRID = 4120?

LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
  • Think you'll need to convert it to another form then to the required SRID something like `DECLARE @g geography;` `SET @g = geography::STGeomFromText('POINT(3 3)', 4326)` `SELECT geography::STGeomFromWKB( geography::STGeomFromWKB(@g.STAsBinary(), @g.STSrid).STAsBinary(),4120 ) ` – Matt Jan 14 '15 at 09:18
  • I need not just change SRIDs. I need to recount coordinates in new coordinate system – Walentyna Juszkiewicz Jan 14 '15 at 14:15
  • In short you cannot do this in SQL. Matt kind of covers this (although you could simplify the transformation to `SELECT geography::STGeomFromWKB(@g.STAsBinary(), 4120);`). To reproject you will need to use Third Party tools to make the unit conversion. – Jon Bellamy Jan 14 '15 at 15:56
  • Jon Bellamy, do you mean SQL Server Spatial Tool? – Walentyna Juszkiewicz Jan 14 '15 at 16:29
  • LongLat coordinates are the same between [4326](http://epsg.io/4326) and [4120](http://epsg.io/4120). The datums are different, but that shouldn't shift the coordinates. – Mike T Feb 02 '15 at 00:12

0 Answers0