mysql - MySQL ST_Intersection 不允许地理 SRS 参数
问题描述
我已经安装了 mysql-community-server 8.0.27,希望ST_Intersection
允许笛卡尔或地理 SRS 中的参数作为文档https://dev.mysql.com/doc/refman/8.0/en/spatial-operator- functions.html#function_st-intersection说,但有一个错误:
mysql> set @b1 = ST_Buffer(ST_SRID(POINT(0, 0), 4326), 1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @b2 = ST_Buffer(ST_SRID(POINT(0, 0), 4326), 2);
Query OK, 0 rows affected (0.00 sec)
mysql> select ST_Intersection(@b1, @b2);
ERROR 3618 (22S00): st_intersection(POLYGON, POLYGON) has not been implemented for geographic spatial reference systems.
虽然可以通过将 SRID 从 4326 更改为 0 来使用笛卡尔参数。
我错过了什么,还是文档不准确?
解决方案
有解决该错误的方法吗?,因为ST_DIFFERENCE
工作正常。
例如,要计算交叉口的面积,预期呼叫:
select ST_Area(ST_Intersection(@b1, @b2));
可以通过以下方式实现:
select ST_Area(@b1) - ST_Area(ST_Difference(@b1, @b2));
推荐阅读
- python - 用 Python 读几行
- php - setDefaultOptions() 必须与 Symfony\Component\Form\FormTypeInterface::setDefaultOptions() 兼容
- google-apps-script - 运行时卡扣失败
- atom-editor - 在 Atom 文本编辑器中运行 npm start
- multiple-columns - Kaggle比赛提交错误:键列''中的值''已被定义
- reactjs - React JS 中的虚拟 DOM 和真实 DOM 的区别?
- javascript - 与直接上传相比,使用库的 Vimeo 上传速度慢
- c# - 使用 SMS 的 ASP.NET Core 2.0 Identity 2FA,在具有多个架构的 TwoFactorSignInAsync() 之后未进行身份验证
- ios - iOS - 更改音频资产 BeatsPerMinute 元数据标签
- sql-server - 获取从当前月份到四月的月份名称