復(fù)制geoc-pg-coordtansform.sql中代碼躺坟,在數(shù)據(jù)庫(kù)執(zhí)行。
鏈接:https://pan.baidu.com/s/1Ps2n4uxSluUr-ADnojMQfA
提取碼:bn9y
示例:
GCJ02轉(zhuǎn)WGS84
select geoc_gcj02towgs84(geom) from test_table
WGS84轉(zhuǎn)GCJ02
select geoc_wgs84togcj02(geom) from test_table
WGS84轉(zhuǎn)BD09
select geoc_wgs84tobd09(geom) from test_table
BD09轉(zhuǎn)WGS84
select geoc_bd09towgs84(geom) from test_table
GCJ02轉(zhuǎn)BD09
select geoc_gcj02tobd09(geom) from test_table
BD09轉(zhuǎn)GCJ02
select geoc_bd09togcj02(geom) from test_table
注意:傳入的geometry參數(shù)的 SRID 必須為4326 或 4490 乳蓄,否則返回null咪橙。