Querying data in MySQL Geometry data type column

萝らか妹 提交于 2019-12-04 19:24:50

After spending way too long messing with this, I came up with the right syntax for the query:

SELECT * FROM sunzones WHERE MBRWITHIN( POINT( 863575.082797506, 2137306.79465704 ) , polygon ) 

The important things to note here are that the coordinates are reversed (longitude/latitude, not latitude/longitude), and unlike most examples posted, I didn't have to use GeomFromText() to declare the Point.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!