SQL SERVER 空间数据

发布于 2024-08-31 18:38:06 字数 189 浏览 0 评论 0原文

我正在努力寻找一种有效的方法来找到与多边形相交的点与该多边形的边界之间的距离。我能够使用 STDistance 将该点与构成多边形的每个点进行比较,但这需要花费大量时间。使用 SPatial 索引并没有多大帮助,因为 STDistance 不是任何约束的一部分,即使我确实放置了约束,索引也没有多大帮助。

我很感激任何反馈。

谢谢。

I am struggling finding an efficient way to find a distance between a Point that intersects a polygon and the border of that polygon. I was able to use the STDistance comparing the point to every point that made up the polygon but that is taking a lot of time. Using SPatial indexed wasn't much helpful because the STDistance is not part of any constraint and even when I did put the constraint, the index didn't help much.

I appreciate any feedback.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怪我太投入 2024-09-07 18:38:06

尝试“扩展盒模型” - 您的搜索会不断增长,直到找到最近的点。

在此处查看各种解决方案和更多说明: http ://blogs.msdn.com/isaac/archive/2008/10/23/nearest-neighbors.aspx

Try the "expanding box model" - your search grows until it finds the nearest point.

Check out a variety of solutions and more explanations here: http://blogs.msdn.com/isaac/archive/2008/10/23/nearest-neighbors.aspx

不再见 2024-09-07 18:38:06

由于您想要找到到边界的距离,因此可以查询到多边形外环的距离,该距离定义为线串。

选择@polygon.STExteriorRing().STDistance(@point)

Since you want to find the distance to the border, you can query for the distance to the exterior ring of the polygon, which is defined as a linestring.

select @polygon.STExteriorRing().STDistance(@point)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文