Lon/Lat Order when using spatial POINT type with MySQL

前端 未结 3 750
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 17:13

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

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

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-20 17:34

    as one can see here https://stackoverflow.com/a/5757054/1393681 the order is (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)

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

提交回复
热议问题