I am running MySQL // Percona 5.7 and I added a Polygon to my table:
DROP TABLE IF EXISTS `test_table`;
CREATE TABLE `test_table` (`uid` int(11) unsigned NOT NULL AUTO_INCREMENT,`geom` geometry NOT NULL, PRIMARY KEY (`uid`), SPATIAL KEY `i_geomidx` (`geom`) );
INSERT INTO `test_table` (`uid`, `geom`) VALUES ('1',ST_GeomFromGeoJSON('{"type": "FeatureCollection","features": [{"type": "Feature","properties": {},"geometry": {"type": "Polygon","coordinates": [[[-91.2,45.4],[-79.8,49.8],[-69.0,43.4],[-88.2,32.6],[-91.2,45.4]]]}}]}',1,4326));
SELECT uid FROM test_table WHERE ( St_intersects(geom,St_geomfromGeoJSON('{"type": "Point", "coordinates": [-80.8,43.7], "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}',1,4326)));
SELECT St_IsValid(geom) FROM test_table;
The first test with the intersect works like a charm but the ST_IsValid function returns the error:
ERROR 1210 (HY000): Incorrect arguments to st_isvalid
But the MySQL help states:
SET @ls1 = ST_GeomFromText('LINESTRING(0 0)');
SELECT ST_IsValid(@ls1);
Any ideas someone?
select ST_GeomFromText('LINESTRING(0 0)');
I don't have a MySQL install to check against any more, but this suggests that MySQL has correctly implemented the standard.select ST_GeomFromText('LINESTRING(0 0)');
return. And what aboutselect ST_GeomFromText('LINESTRING(0 0, 1 1)')
? That is your answer.