I am trying to insert features into my SQL 2008 database using the WKT generated from the .GetWellKnownText function on features in the editlayer in my map. Linestrings and circles appear to be working normally. However rectangle, square and ellipse polygon shapes fail on the SQL insert. Here are some of my insert statements and the exceptions I am getting.
"INSERT INTO ContentBubbles_New (CB_Name, CB_Geo) VALUES ('Test Rect', geography::STGeomFromText('POLYGON((-121.0187065874 50.300440064126,-121.0187065874 53.038689270063,-116.85180562184 53.038689270063,-116.85180562184 50.300440064126,-121.0187065874 50.300440064126))', 4326))"
"A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": Microsoft.SqlServer.Types.GLArgumentException: 24205: The specified input does not represent a valid geography instance because it exceeds a single hemisphere. Each geography instance must fit inside a single hemisphere. A common reason for this error is that a polygon has the wrong ring orientation. Microsoft.SqlServer.Types.GLArgumentException: at Microsoft.SqlServer.Types.GLNativeMethods.ThrowExceptionForHr(GL_HResult errorCode) at Microsoft.SqlServer.Types.GLNativeMethods.GeodeticIsValid(GeoData g) at Microsoft.SqlServer.Types.SqlGeography.IsValidExpensive() at Microsoft.SqlServer.Types.SqlGeography.ConstructGeographyFromUserInput(GeoData g, Int32 srid) at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid) . The statement has been terminated."
--Ellipse--
"INSERT INTO ContentBubbles_New (CB_Name, CB_Geo) VALUES ('test ellipse', geography::STGeomFromText('POLYGON((-98.7555687210394 40.7761189519884,-98.7555722819312 40.7761193125802,-98.755575636218 40.7761200199066,-98.7555786549963 40.7761210467853,-98.7555812222563 40.776122353754,-98.7555832393394 40.7761238905866,-98.7555846287305 40.7761255982234,-98.7555853370359 40.7761274110411,-98.7555853370359 40.7761292593739,-98.7555846287305 40.7761310721916,-98.7555832393394 40.7761327798284,-98.7555812222563 40.776134316661,-98.7555786549963 40.7761356236297,-98.755575636218 40.7761366505084,-98.7555722819312 40.7761373578348,-98.7555687210394 40.7761377184266,-98.7555650903856 40.7761377184266,-98.7555615294938 40.7761373578348,-98.755558175207 40.7761366505084,-98.7555551564287 40.7761356236297,-98.7555525891687 40.776134316661,-98.7555505720856 40.7761327798284,-98.7555491826945 40.7761310721916,-98.7555484743891 40.7761292593739,-98.7555484743891 40.7761274110411,-98.7555491826945 40.7761255982234,-98.7555505720856 40.7761238905866,-98.7555525891687 40.776122353754,-98.7555551564287 40.7761210467853,-98.755558175207 40.7761200199066,-98.7555615294938 40.7761193125802,-98.7555650903856 40.7761189519884,-98.7555687210394 40.7761189519884))', 4326))"
"A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": System.ArgumentException: 24200: The specified input does not represent a valid geography instance. System.ArgumentException: at Microsoft.SqlServer.Types.SqlGeography.ConstructGeographyFromUserInput(GeoData g, Int32 srid) at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid) . The statement has been terminated."
I found the following forum threads with similar problems. Is there an update that I need to handle the geography data type?
gis.thinkgeo.com/Support/Dis...fault.aspx
gis.thinkgeo.com/Support/Dis...aspx#11230