mySQL converting lat/lon to spatial

INSERT INTO myTable (coordinates)
SELECT GeomFromText(CONCAT('POINT(',ot.latitude, ' ', ot.longitude,')'))
FROM otherTable ot;

or

UPDATE myTable
SET coordinates = GeomFromText(CONCAT('POINT(',latitude, ' ', longitude,')'));

Back to Top