在MySQL上使用空间POINT类型时的Lon/Lat Order [英] Lon/Lat Order when using spatial POINT type with MySQL

查看:115
本文介绍了在MySQL上使用空间POINT类型时的Lon/Lat Order的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MySQL中设置POINT时正确的顺序是什么?

What is the correct order when setting a POINT in MySQL?

SO问题中的答案在以下方面也有所不同: 将lat/lon文本列移动到点"类型列

Even the answers in SO questions differ on this: Moving lat/lon text columns into a 'point' type column

POINT(lat lon)

POINT(lon lat)

就我所知,它应该是POINT作为参数x和y的第一个版本(纬度),但我找不到确切的证据.

As far, as i see it, it should be the first version (lat lon) as the POINT takes as params x and y, but i was not able to find an definite evidence.

推荐答案

正如在此处看到的 https://stackoverflow.com/a/5757054/1393681 顺序是(lon lat).

as one can see here https://stackoverflow.com/a/5757054/1393681 the order is (lon lat).

lon 基本上是y轴, lat 基本上是x,但是 lon沿x轴行进 lat沿y轴,所以我认为这就是您使用(lon lat)

lon is basicly the y axis and lat the x if i look at my globe, but the lon's are traveling along the x axis and the lat's along the y axis so i think thats the reason why you use (lon lat)

尽管如此,如果您在应用程序中保持一致,则世界是否在db内翻转无关紧要;-)

Despite that, if you stay consistent in your application it shoudn't matter if the world is flipped inside your db ;-)

这篇关于在MySQL上使用空间POINT类型时的Lon/Lat Order的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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