Description:
input specific data to sql : select st_intersects(geo1, geo2);
if exchange the order of input geo, such as (geo2, geo1), will get opposite result
mysql> select st_intersects(st_geomfromtext('POLYGON((-0.000000001 0.000000001,-0.000000001 0.000000002,0 0.000000002,0 0.000000001,-0.000000001 0.000000001))' ,4326), st_geomfromtext('POLYGON((0 0,0 0.000000001,0.000000001 0.000000001,0.000000001 0,0 0))' ,4326));
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| st_intersects(st_geomfromtext('POLYGON((-0.000000001 0.000000001,-0.000000001 0.000000002,0 0.000000002,0 0.000000001,-0.000000001 0.000000001))' ,4326), st_geomfromtext('POLYGON((0 0,0 0.000000001,0.000000001 0.000000001,0.000000001 0,0 0))' ,4326)) |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 0 |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select st_intersects(st_geomfromtext(' POLYGON((0 0,0 0.000000001,0.000000001 0.000000001,0.000000001 0,0 0))' ,4326), st_geomfromtext('POLYGON((-0.000000001 0.000000001,-0.000000001 0.000000002,0 0.000000002,0 0.000000001,-0.000000001 0.000000001))' ,4326));
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| st_intersects(st_geomfromtext(' POLYGON((0 0,0 0.000000001,0.000000001 0.000000001,0.000000001 0,0 0))' ,4326), st_geomfromtext('POLYGON((-0.000000001 0.000000001,-0.000000001 0.000000002,0 0.000000002,0 0.000000001,-0.000000001 0.000000001))' ,4326)) |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
How to repeat:
select st_intersects(st_geomfromtext('POLYGON((-0.000000001 0.000000001,-0.000000001 0.000000002,0 0.000000002,0 0.000000001,-0.000000001 0.000000001))' ,4326), st_geomfromtext('POLYGON((0 0,0 0.000000001,0.000000001 0.000000001,0.000000001 0,0 0))' ,4326));
select st_intersects(st_geomfromtext(' POLYGON((0 0,0 0.000000001,0.000000001 0.000000001,0.000000001 0,0 0))' ,4326), st_geomfromtext('POLYGON((-0.000000001 0.000000001,-0.000000001 0.000000002,0 0.000000002,0 0.000000001,-0.000000001 0.000000001))' ,4326));
Suggested fix:
Is it caused by boost::geometry lib?