当前位置: 首页 > 工具软件 > GCJ > 使用案例 >

PostgreSQL和PostGISWGS84和CGCS2000与GCJ02和BD09坐标系与之间互转

陆城
2023-12-01

– 如果转换后结果为null,查看geom的srid是否为4326或者4490
WGS84转GCJ02
select geoc_wgs84togcj02(geom) from test_table
GCJ02转WGS84
select geoc_gcj02towgs84(geom) from test_table

WGS84转BD09
select geoc_wgs84tobd09(geom) from test_table
BD09转WGS84
select geoc_bd09towgs84(geom) from test_table

CGCS2000转GCJ02
select geoc_cgcs2000togcj02(geom) from test_table
GCJ02转CGCS2000
select geoc_gcj02tocgcs2000(geom) from test_table

CGCS2000转BD09
select geoc_cgcs2000tobd09(geom) from test_table
BD09转CGCS2000
select geoc_bd09tocgcs2000(geom) from test_table

GCJ02转BD09
select geoc_gcj02tobd09(geom) from test_table
BD09转GCJ02
select geoc_bd09togcj02(geom) from test_table
PostgreSQL安装PostGIS扩展
复制geoc-pg-coordtansform.sql中代码,在数据库执行

CREATE OR REPLACE FUNCTION “public”.“geoc_bd09towgs84_multipolygon”(“source_geom” “public”.“geometry”)
RETURNS “public”.“geomet

 类似资料: