1

Is there a way to convert geometry column value which has GDA94 / MGA zone 55 coordinate reference system into Geography value in SQL server 2012. The layer is a multipolygon layer

We were having the WGS 84 system before and the below code was working fine

SELECT GEOGRAPHY::STGeomFromText(ogr_geometry.STAsText(),4326).MakeValid() FROM TableA

But now the code is returning error

Msg 6522, Level 16, State 1, Line 40
A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": 
System.FormatException: 24201: Latitude values must be between -90 and 90 degrees.

Can someone explain this error?

  • 1
    It's not valid to just slap a 4326 SRID on projected coordinates and ask for a cast. The function you require is ST_Transform, which is not available from Microsoft, even in much more recent SQL Server releases. You will need to use a third-party tool to reproject the column contents. – Vince Aug 2 '19 at 11:15
  • @Vince - thanks for your comment. So I understand this cannot be done in sql server. we are getting the data into sql server table from ".gdbtable" files using ogr2ogr.exe. I will need to try to project the geometry to WGS 84 before storing into the table..! – DJs Aug 4 '19 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.