有一个要求是不能用double类型,float类型也不能用。
那么在mysql中使用什么样的类型存储经纬度比较合适呢?
如果要存为varchar类型,php中两者该如何转换呢?
如果存为int类型,是否要使用bigint,还是说int就能满足呢?
大家讲道理2017-04-17 13:28:43
You can use string varchar
, and then convert the string into double
type or float
type
伊谢尔伦2017-04-17 13:28:43
Mysql supports the Geometry type, but it is more troublesome to operate.
PHPz2017-04-17 13:28:43
Just convert it to plastic storage. If the accuracy is required to be 8 decimal places, multiply it by 10^8 and store it in the database