MySQL Spatial CONTAINS shows wrong result

六月ゝ 毕业季﹏ 提交于 2019-12-05 11:30:05

CONTAINS function does not search in precise object shape. It uses bounding rectangle around your polygon. You can try ST_CONTAINS function, which is available from MySQL 5.6.1

Functions That Test Spatial Relationships Between Geometries

Ok, I have fugired out that MYSQL uses bounding-boxes around the GEOMETRY.

MySQL Spatial has some substantial disadvantages. On the plus side, it does have spatial types, functions and an index. And it follows the OGC specification for geometry representations. However, the number of functions MySQL supports is very small, and as a result it is difficult to use the database for anything more complex that simple storage and retrieval-by-bounding-box use cases. Additionally, because the spatial option is implemented in the (non-transactional) MyISAM table type, it is not possible to use spatial objects within transactions.

http://workshops.opengeo.org/postgis-spatialdbtips/introduction.html

It looks like a bad joke...

Going to use PostgreSQL instead.

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