我的空间实例出了什么问题?
我正在尝试为 SQL Server 2008 空间类型创建地理多边形(一个简单的框):
select geography::STPolyFromText('POLYGON((18.123632669448853 59.299458646827844,
18.103247880935669 59.299458646827844, 18.103247880935669 59.304935824311556,
18.123632669448853 59.304935824311556, 18.123632669448853 59.299458646827844))'
, 4326)
我不断收到“指定的输入不代表有效的地理实例”。我不明白这有什么问题。如果我使用 LINESTRING 在 SQL MGM Studio 的空间结果视图中绘制框的每一行,则一切看起来都很好。
如果我在所有经度前面加上一个减号,它也可以创建(但显然它不一样)。
I am trying to create a geography polygon (a simple box) for SQL Server 2008 spatial types:
select geography::STPolyFromText('POLYGON((18.123632669448853 59.299458646827844,
18.103247880935669 59.299458646827844, 18.103247880935669 59.304935824311556,
18.123632669448853 59.304935824311556, 18.123632669448853 59.299458646827844))'
, 4326)
I keep getting "The specified input does not represent a valid geography instance." and I cannot understand what's wrong with it. If I use LINESTRING to plot each line of the box in the Spatial Results view of the SQL MGM Studio, everything looks fine.
If I put a minus sign in front of all the longitudes it can be created too (but obviously it is not the same).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于某种原因,多边形的外环必须按逆时针顺序定义;内环顺时针旋转。所以交换你的第二点和第四点,你应该会很好。
For some reason, exterior rings of a polygon have to be defined in anti-clockwise order; interior rings clockwise. So swap your second and fourth points over and you should be good.