Convert pares lat / lng usando GeomFromText ('POINT (1 1)') e insira em outra coluna
Na minha pergunta anterior Pesquise as coordenadas de latitude / longitude do intervalo Minha solução foi criar a tabela abaix
mysql> select * from spatial_table where MBRContains(GeomFromText('LINESTRING(9 9, 11 11)'), my_spots);
+------+---------------------------------+
| id | my_spots | my_polygons |
+------+-------------+-------------------+
| 1 | $@ $@ $@ $@ |
+------+-------------+-------------------+
Agora preciso converter e mover meus pares lat / lng existentes na tabela abaixo para spatial_table. Como eu estruturaria minha consulta para conseguir isso? Atualmente, estou usando as consultas abaixo para inserir.
mysql> insert into spatial_table values (1, GeomFromText('POINT(1 1)'), GeomFromText('POLYGON((1 1, 2 2, 0 2, 1 1))'));
Query OK, 1 row affected (0.00 sec)
mysql> insert into spatial_table values (1, GeomFromText('POINT(10 10)'), GeomFromText('POLYGON((10 10, 20 20, 0 20, 10 10))') );
Query OK, 1 row affected (0.00 sec)
Tabela existente:
+-------------+---------+--------+-----------+----- ------+-------------+--------------+
| location_id | country | region | city | latitude | longitude | name |
+=============|=========|========|===========|============|=============|==============|
| 316625 | US | CA | Santa Cruz| 37.044799 | -122.102096 | Rio Theatre |
+-------------+---------+--------+-----------+------------+-------------+--------------+