I'm trying to UPDATE
a Geography field in an SQL Server 2012 database using the output of a web mapper. I got the dreaded "The specified input does not represent a valid geography instance because it exceeds a single hemisphere," error when running the command. I found that by reversing the order of the vertices the UPDATE
command works as expected.
I see that SQL Server 2012 includes a ReorientObject() method that does this task, but I don't know how to incorporate it into my SQL UPDATE
command. The following returns the same "single hemisphere" error.
UPDATE tblProjects
SET tblProjects.Boundary = geography::STGeomFromText( 'POLYGON ((-93.30388806760311 27.994401411046173, -94.62224744260311 33.37641235124676, -79.70281384885311 31.80289258670676, -93.30388806760311 27.994401411046173))',4326).ReorientObject()
WHERE tblProjects.ProjectID = 1 ;