空间数据类型

3
我觉得我找不到我(显然很蠢)的错误:-)。
在数据库中以下SELECT语句:
SELECT geography::STMPolyFromText('MULTIPOLYGON( (((11.791039 47.5448077, 11.7910551 47.544757, 11.7911677 47.5446375, 11.7644687 47.542786))) )',4326)

错误信息如下:

NET Framework error occurred during execution of user-defined routine or aggregate "geography": 
System.FormatException: 24141: A number is expected at position 26 of the input. The input has (11.791039.
System.FormatException: 
   at Microsoft.SqlServer.Types.WellKnownTextReader.RecognizeDouble()
   at Microsoft.SqlServer.Types.WellKnownTextReader.ParseLineStringText()

找不到我的错误,也许你们中的一个看到了错误?!


刚刚找到了解决方法:多了一个“(”。

1个回答

1

我认为在MULTIPOLYGON之后,你多了一个括号对... 这个例子只展示了3个, 但是你却有4个。

相反地,请尝试:

SELECT geography::STMPolyFromText
(
    'MULTIPOLYGON
    ( 
        (
            (
                11.791039 47.5448077, 
                11.7910551 47.544757, 
                11.7911677 47.5446375, 
                11.7644687 47.542786
            )
        ) 
    )',4326
)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接