28. MySQLでの地球上の座標の表し方
■テーブルの作成。SRIDを指定する。
CREATE TABLE mygeo3
(id INTEGER,
pnt POINT SRID 4326);
INSERT INTO mygeo3 VALUES (1,
ST_GeomFromText('POINT(43.057265 141.389053)', 4326));
■データの挿入。SRIDを指定する。
■SRIDを指定しないとエラーになる
mysql> INSERT INTO mygeo3 VALUES (1, ST_GeomFromText('POINT(43.057265 141.389053)'));
ERROR 3643 (HY000): The SRID of the geometry does not match the SRID of the column
'pnt'. The SRID of the geometry is 0, but the SRID of the column is 4326.
Consider changing the SRID of the geometry or the SRID property of the column.
SRIDがちゃうで。カラムで 4326 言うてるんやから、0なんて呉れたら、
あかんて。