This project is read-only.

ST.RelateQuery question

Topics: User Forum
Dec 3, 2006 at 2:07 AM
I run the query in SQL Server 2005 to get an exception in the scalar function 'GeomFromText'

I don't know enough C# to follow the source code to track the error.

Any help with that would be great.
Thank you.

Lester J. Williams
U.S. Geological Survey


FROM ST.RelateQuery('states_poly', 'GEOMETRY', ST.GeomFromText('POLYGON(2000 1000, 2000 2000, 3000 1000)',-1), 'Contains') AS q
INNER JOIN states_poly AS t ON q.oid = t.oid

Error msg:

Msg 6522, Level 16, State 1, Line 1
A .NET Framework error occurred during execution of user defined routine or aggregate 'GeomFromText':
GisSharpBlog.NetTopologySuite.IO.ParseException: Expected word but encountered number: 2000
at GisSharpBlog.NetTopologySuite.IO.WKTReader.GetNextWord(IList tokens) ......

Dec 4, 2006 at 5:50 PM
1) Add extra parentesis to denote the external ring.
2) Add the closing point of the ring (same as the first point).

POLYGON(2000 1000, 2000 2000, 3000 1000)
POLYGON((2000 1000, 2000 2000, 3000 1000, 2000 1000))

Best regards,
Ricardo Stuven.
Dec 4, 2006 at 6:19 PM
This discussion has been copied to Work Item 6232. You may wish to continue further discussion there.