sql查询多边形/矩形中的点 [英] sql query for points in polygon/rectangle

查看:156
本文介绍了sql查询多边形/矩形中的点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我有一个非常大的财产信息数据库,其中包括地理坐标.我需要做的是运行一个查询,询问给定给定矩形或多边形内的所有属性".用户界面将允许用户定义矩形或多边形的点(使用地图系统).这些坐标将进入查询,并且sql应该返回该区域中的属性列表.如果不可能使用多边形,则至少要有一个矩形会有所帮助.我已经知道如何进行半径搜索.

Ok, so I have a very large database of property information, complete with geographic coordinates. What I need to be able to do is run a query that asks, "give me all properties that are inside a given rectangle or polygon." The user interface would allow the user to define the points of the rectangle or polygon (using a map system). These coordinates would go into the query and sql should return a list of properties in that area. If polygon isn't possible, at least a rectangle would be helpful. I already know how to do the radius search.

感谢您可以提供的任何帮助.

Appreciate any help you can provide.

推荐答案

MySQL支持几何函数和查询.参考文档将对您有所帮助: https://dev.mysql.com/doc/refman/5.7/zh-CN/spatial-relation-functions.html

MySQL support geometrical function and queries. Reference document would be helpful for you : https://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions.html

这篇关于sql查询多边形/矩形中的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆