A .NET Framework error occurred during execution of user defined routine or
aggregate 'geometry'.
Applies to: Microsoft SQL Server 2008 (Katmai) November CTP (CTP 5).
Error Message.
(local)(domainname\amorillo): Msg 6522, Level 16, State 1, Line 3
A .NET Framework error occurred during execution of user defined routine or
aggregate 'geometry':
System.FormatException: 24141: A number is expected at position 41 of the input.
The input has o.
System.FormatException:
at Microsoft.SqlServer.Types.OpenGisWktReader.RecognizeDouble()
at Microsoft.SqlServer.Types.OpenGisWktReader.ParsePoint()
at
Microsoft.SqlServer.Types.OpenGisWktReader.ParseLineStringText(FigureAttributes
attributes)
at Microsoft.SqlServer.Types.OpenGisWktReader.ParsePolygonText()
at Microsoft.SqlServer.Types.OpenGisWktReader.ParsePolygonTaggedText()
at Microsoft.SqlServer.Types.OpenGisWktReader.ParseGeometryTaggedText()
at Microsoft.SqlServer.Types.OpenGisWktReader.ReadGeometry()
at Microsoft.SqlServer.Types.SqlGeometry.STGeomFromText(SqlChars
geometryTaggedText, Int32 srid)
.
Cause.
You get this error message in Microsoft SQL Server 2008, when you execute a
SELECT statement and that statement processes invalid geometry objects, as in
the example below:
SET @shape = geometry::STGeomFromText(
'POLYGON ((0 0, 150 0, 150 150, 0 150, o 0))',0)
SELECT @shape.ToString()
As you can see in the image, when defining the polygon's points we typed and "o"
instead of zero.
Solution.
Review your geometry objects and correct where needed.