Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL:dati GIS non validi forniti per la funzione st_geometryfromtext

Devi specificare il primo e l'ultimo punto allo stesso modo.

Prova questo.

SET @poly =
    'Polygon((-98.07697478272888 30.123832577126326,
              -98.07697478272888 30.535734310413392,
              -97.48302581787107 30.535734310413392,
              -97.48302581787107 30.123832577126326,
              -98.07697478272888 30.123832577126326,))';

SELECT name
FROM county_shapes
WHERE MBRContains(ST_GeomFromText(@poly), SHAPE);

E

SELECT name
FROM county_shapes
WHERE MBRContains(ST_GeomFromText('Polygon((
              -98.07697478272888 30.123832577126326,
              -98.07697478272888 30.535734310413392,
              -97.48302581787107 30.535734310413392,
              -97.48302581787107 30.123832577126326,
              -98.07697478272888 30.123832577126326))'), SHAPE);