MySQL 5.7错误:无法从发送到GEOMETRY字段的数据中获取几何对象 [英] MySQL 5.7 error: Cannot get geometry object from data you send to the GEOMETRY field

查看:1186
本文介绍了MySQL 5.7错误:无法从发送到GEOMETRY字段的数据中获取几何对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一栏使我对MySQL Server 5.7.11感到头疼.

I have a column that is giving me a headache on MySQL Server 5.7.11.

它的类型为POINT,我可以毫无问题地将其更改为类型GEOMETRY.

It was of type POINT and I was able to change it to type GEOMETRY with no issues.

当我现在尝试将其从GEOMETRY更改为POINT时,出现以下错误:

When I now try and change it from GEOMETRY to POINT I get the following error:

Error 1416: Cannot get geometry object from data you send to the GEOMETRY field SQL Statement: ALTER TABLE CHANGE COLUMN列名列名POINT NOT NULL;

Error 1416: Cannot get geometry object from data you send to the GEOMETRY field SQL Statement: ALTER TABLEtable CHANGE COLUMNcolumn_namecolumn_namePOINT NOT NULL;

我认为为什么我可以以一种方式而不是另一种方式更改它.

I doesn't make sense to me why I could change it one way and not the other.

我在使用POINT数据类型时遇到了麻烦,尤其是当我尝试执行select语句时,有时会出现相同的错误.

I have been having trouble with the POINT datatype, especially when I try and do select statements, it sometimes comes with the same error.

推荐答案

"GEOMETRY可以存储任何类型的几何值.其他单值类型(POINT,LINESTRING和POLYGON)将其值限制为特定的几何类型. "

"GEOMETRY can store geometry values of any type. The other single-value types (POINT, LINESTRING, and POLYGON) restrict their values to a particular geometry type."

因此您可以将POINT转换为GEOMETRY-但是因为GEOMETRY可以包含其他几何值,所以您不能采用其他方法.

So you can convert POINT to GEOMETRY - but because GEOMETRY can contain other geometry values you cannot go the other way.

https://dev.mysql.com/doc/refman/5.7/en/spatial-datatypes.html

这篇关于MySQL 5.7错误:无法从发送到GEOMETRY字段的数据中获取几何对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆