在 MySQL 中查找具有定义多边形内坐标的行
我试图弄清楚如何返回一组在多边形内具有坐标的记录。
我已经查看了 MySQL 空间扩展,但它们当前不支持在指定多边形内搜索,仅支持在多边形的最小边界矩形内搜索。
我想知道是否有人以前遇到过这个问题并知道任何解决方案?
谢谢
I'm trying to figure out how to go about returning a set of records which have coordinates within a polygon.
I have looked at the MySQL spacial extensions but they don't currently support searching within a specified polygon, only within the minimal bounding rectangle of the polygon.
I was wondering if anyone has come across this problem before and knew of any solutions?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能没有(也不会)对此的内置支持,因为确定一个点是否在通用多边形内是一个 相当复杂的问题。
也许您应该获取适合边界矩形的“候选”点,然后通过这些 PIP 算法之一运行它们来找到实际多边形中的点。
There probably isn't (and won't be) built-in support for that, because determining if a point is within a generic polygon is a rather complex problem.
Perhaps you should get the "candidate" points that fit into the bounding rectangle, then find the ones in the actual polygon by running them through one of those PIP algorithms.
与 this 我已经解决了类似的问题...希望它有所帮助。
with this I have solve my similar issue... hope it helps.