Mysql 5.1空间重叠为什么不能正常工作?

时间:2012-10-15 11:33:54

标签: mysql geospatial

我正在对MySQL 5.1进行空间操作测试,我发现一些问题与多边形重叠多边形。 测试集 1)多面体:上面有2个多边形,一个代表法国大陆,另一个代表科西嘉岛 2)多边形。只是一个矩形。 3)多面和多边形,不重叠。与JTS测试构建者一起测试 4)MySQL返回重叠。

我做错了什么?你知道它是否重叠它认为多边形边界框而不是多边形边界(看起来就像这种情况)。

提前致谢,

哈维

这里是测试查询:

SELECT   overlaps(
GeomFromText('MULTIPOLYGON(
((
-1.5719044 45.66331767,
-1.66445017 44.15596196,
-2.09633041 43.35382557,
-1.44851005 42.79046377,
0.98852813 42.40442147,
2.16077434 42.15335565,
3.57980926 42.24476801,
3.36386913 42.9035504,
4.13508385 43.24156757,
6.44872768 42.69984551,
8.00528012 44.22125179,
7.43172878 44.63085344,
7.47952458 45.30714395,
6.9537692 46.70140581,
8.10087187 47.70798437,
8.19646379 48.47416978,
8.67442321 49.16649286,
5.42429902 49.94163752,
4.75515576 50.46172136,
2.07858291 51.36572924,
1.1226639 50.82543226,
0.59690852 50.21768192,
-0.69358204 49.6640024,
-1.98407259 50.06452024,
-2.55762393 49.5090723,
-1.93627663 48.9472454,
-2.55762393 48.88442555,
-3.99150219 49.16649286,
-5.37758466 48.60075831,
-5.42538062 47.90060118,
-4.03929815 47.41771923,
-2.84439951 46.96299696,
-2.03186838 46.2405562,
-1.5719044 45.66331767,
-1.5719044 45.66331767
)),
((
7.03485087 43.06152362,
8.23794566 42.56366976,
8.19646379 41.73912551,
8.67442321 41.09395768,
9.86932185 41.20193051,
9.86932185 42.72995934,
9.1523828 43.49754453,
8.23794566 42.56366976,
7.03485087 43.06152362,
7.03485087 43.06152362
))
)
')
, 

GeomFromText('POLYGON((
1.1578032214844 40.974486726133,
1.1578032214844 41.79873497231,
3.1820341785157  41.79873497231,
3.1820341785157 40.974486726133,
1.1578032214844 40.974486726133
))')

1 个答案:

答案 0 :(得分:0)

重叠和MBROverlaps在MysQL 5.1上是相同的功能。我在documentation上错过了这条评论:

注意 目前,MySQL没有根据规范实现这些功能。实现的那些返回与相应的基于MBR的函数相同的结果。

似乎从MySQL 5.6开始,mysql将支持多边形的重叠,ST_Overlaps