我有一张带有polygon几何的桌子。我正在尝试基于点的邻近性来过滤行。
我使用st_distance_sphere计算距离并过滤行:链接
关于mysql表的快照、它的内容和我想要做的事情,请查看以下链接:8.0&fiddle=9e8bfca54f665f411453791c300c7fbd
当我运行查询时,
select *
from geo
where st_distance_sphere(Point(35.0872464,-106.6975887), ST_Centroid(`spatialdata`)) <= 1609*10;我收到一个错误:
Error Code: 3617. Latitude -106.646665 is out of range in function st_distance_sphere. It must be within [-90.000000, 90.000000].
我想我需要用Long, Lat轴来计算距离。如何在mysql中做到这一点?
让人有点困惑的是: MySQL已经将所有几何学标准化为lat-long轴序。来自文档:The EPSG has standardized on latitude-longitude order, so all geographic SRSs defined by default in MySQL are latitude-longitude.
Doc链接:https://dev.mysql.com/blog-archive/axis-order-in-spatial-reference-systems/
发布于 2022-06-05 17:26:49
反转查询中Point对象中两个常量的顺序。
Point(-106.6975887, 35.0872464)https://stackoverflow.com/questions/72509502
复制相似问题