循环字符串的SQL Server 2008 R2 geoSpatial查询错误 [英] SQL-Server 2008 R2 geoSpatial query error for Circular String

查看:84
本文介绍了循环字符串的SQL Server 2008 R2 geoSpatial查询错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL空间功能:SQL几何点,线串工作正常,但圆形字符串不工作.当我尝试将CircularString类型的数据保存到我的几何数据类型时,它会引发以下错误:

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:

我的声明:

DECLARE @g1 geometry = 'CIRCULARSTRING EMPTY';

在执行用户定义的过程中发生了.NET Framework错误 例程或聚合几何":System.FormatException:24114: 输入的知名文字(WKT)中的标签CIRCULARSTRING EMPTY不是 有效的.有效标签为POINT,LINESTRING,POLYGON,MULTIPOINT, MULTILINESTRING,MULTIPOLYGON或GEOMETRYCOLLECTION."

"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."

这是我的SQL版本(我正在使用SQL Server 2008 R2)还是我做错了.

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

推荐答案

据我从文档中得知,实例化曲线似乎是 LineString 顾名思义,它编码一系列线段.因此,最好的选择是将圆近似为一个具有足够角数的(可能是规则的)多边形.如果不能接受,则可能必须保留当前数据结构(排他性地或除空间数据类型之外),以验证那里的匹配确实与圆匹配.

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.

请参见链接上的参考.

这篇关于循环字符串的SQL Server 2008 R2 geoSpatial查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆