MySQL更新地理点 [英] mysql update geo point
本文介绍了MySQL更新地理点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有经度和纬度值的MySQL表。我想玩弄MySQL 5中的空间内容,看看它是如何工作的。
然而,我刚刚得到创建点数据的实际问题从现有的价值。我正在尝试这样的事情,但它在我尝试过的每种格式中都会出现语法错误。有人可以指出正确的做法吗?
更新位置表a SET geopoint = GeomFromText(POINT()a.latitude a .longitude)WHERE 1
我也尝试了其他变体,包括:
pre $ UPDATE location表a SET geopoint = SET geopoint = GeomFromText('POINT()a.latitude a.longitude')WHERE 1
其他...
解决方案
你的意思是做这个吗?:
UPDATE locationtable as a
SET a.geopoint = POINT(a.latitude,a.longitude)
I have a MySQL table with latitude and longitude values. I want to play around with the spatial stuff in MySQL 5, just to see how it works.
However, I'm having a real problem just getting the point data created from existing values. I was trying something like this, but it fails with syntax errors in every format I've tried. Can someone point out the right way to do this?
UPDATE locationtable a SET geopoint = GeomFromText( POINT() a.latitude a.longitude ) WHERE 1
I've also tried other variations, including:
UPDATE locationtable a SET geopoint = GeomFromText( 'POINT()' a.latitude a.longitude ) WHERE 1
UPDATE locationtable a SET geopoint = GeomFromText( 'POINT() a.latitude a.longitude' ) WHERE 1
And others…
解决方案
Do you mean to do this?:
UPDATE locationtable AS a
SET a.geopoint = POINT( a.latitude, a.longitude )
这篇关于MySQL更新地理点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文