SQL-Server 2008 R2 geoSpatial query error for Circ

2019-09-20 06:02发布

SQL Spatial Features: SQL geometry Point, Linestring working well but the Circular string is not working. When i try to save the CircularString type data to my geometry datatype its throws the following error:

My statement:

DECLARE @g1 geometry = 'CIRCULARSTRING EMPTY';

"A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry": System.FormatException: 24114: The label CIRCULARSTRING EMPTY in the input well-known text (WKT) is not valid. Valid labels are POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, or GEOMETRYCOLLECTION."

Is this due my SQL Version ( I Am Using SQL Server 2008 R2) or I am doing something wrong.

1条回答
Luminary・发光体
2楼-- · 2019-09-20 06:34

As far as I can tell from the docs, CircularString was only added for SQL Server 2012. The only other instantiable curve appears to be LineString which, as the name suggests, encodes a sequence of line segments. So your best bet would be approximating the circle as a (possibly regular) polygon with a sufficient number of corners. If that is not acceptable, you might have to keep your current data structures in place, either exclusively or in addition to spatial data types to verify that a match there indeed matches the circle.

This answer was written purely from the docs, with no experience to support it.

Please see reference on link.

查看更多
登录 后发表回答