使用 MySQL 查找包含某个点的区域
我正在使用 MySQL GIS 和 Spatial Extensions。
我有一个表格,其中包含由纬度、经度和半径描述的“圆形”区域。
我需要一个查询来获取其区域包含由纬度和经度定义的给定点的所有行。 “圆形”区域可以相交,因此该点可以落在多个区域中。
I'm using MySQL GIS and Spatial Extensions.
I've a table with "circular" regions described by latitude, longitude and radius.
I need a query to get all the rows whose region include a given point defined by a latitude and a longitude. The "circular" regions can intersect and therefore the point can fall in more than one region.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想出了一个解决方案,我想将其发布在这里只是为了对此发表意见。请注意,上面的表结构略有修改,添加了一个新列“location POINT”,该列是使用每次插入时的纬度和经度构建的。
I came up with a solution and I would like to post it here just to have an opinion about it. Notice that the table structure above was slightly modified by adding a new column "location POINT" that is built using the latitude and the longitude at each insert.