create table GDATA ( x DOUBLE not null, y DOUBLE not null, pt POINT DEFAULT NULL ) ENGINE=MyISAM DEFAULT charset=utf8;
update GDATA set pt = PointFromText( concat( ‘POINT(’,x,' ',y,')' ) ); create table GDATA2 ( x DOUBLE not null, y DOUBLE not null, SPATIAL KEY `sp_index` (`pt`) ) ENGINE=MyISAM DEFAULT charset=utf8;
insert into GDATA2(x,y,pt) select x,y,pt from GDATA;