为什么POINT()存储为??*??E@z?3米??Q在mysql表中



我不明白为什么MySQL GIS中的POINT数据类型被插入为??*??E@z?3M??Q?

我的代码在下面。如果有任何帮助,我将不胜感激,我已经花了很长时间四处修修补补和阅读这些文档。提前谢谢!

我的查询:

insert into locations values(null, POINT(43.005895, -71.013202), 'Car wash');

我的桌子:

CREATE TABLE locations (
  location_id int(10) unsigned NOT NULL AUTO_INCREMENT,
    coordinates point NOT NULL,
    name varchar(20) NOT NULL,
  PRIMARY KEY (location_id)
     ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1

您可以使用ST_AsText()将GIS数据从内部格式转换为WKT字符串:

SELECT location_id, ST_AsText(coordinates) as coordinates, name
FROM locations

最新更新