SQL-Server 2008 R2 geoSpatial query error for Circular String

徘徊边缘 提交于 2019-12-13 08:13:58

问题


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:


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.



来源:https://stackoverflow.com/questions/27033997/sql-server-2008-r2-geospatial-query-error-for-circular-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!