1、在postgresql數據庫中,如果字段類型是geometry,更新該字段為經緯度(坐標),可以嘗試采取以下腳本:
注意:108.658463 代表經度 34.1437代表緯度 中間沒有逗號
1 update table set geom = ST_GeomFromText('POINT(108.658463 34.1437)', 4490) where id = 123
2、一組幾何坐標:
注意:此時關鍵字為 POLYGON
1 update building set geom = ST_GeomFromText('POLYGON((121.415703 31.172893,121.415805 31.172664,121.416127 31.172751,121.41603 31.172976,121.415703 31.172893))',4490) where id = 123
3、如果想要看geom的經緯度坐標:
1 SELECT ST_AsText(geom) FROM table where id = 123