坐标系转换工具,支持 GeoJSON 和 WKT 格式,支持中国常用坐标系。
代码名称说明4326WGS84GPS 标准,地理坐标4490CGCS2000中国 2000 国家坐标系4547-4556CGCS2000 分带3 度分带投影坐标系3857Web Mercator互联网地图常用4214Beijing 1954北京 54 坐标系gcj02火星坐标系高德地图、腾讯地图使用bd09百度坐标系百度地图专属
bash
apt-get install python3-pyproj
text
python3 scripts/coord_convert.py --input <文件或字符串> --from <源坐标系> --to <目标坐标系> [--format <输出格式>] [--output <输出文件>]
参数说明--input / -i输入文件路径或 GeoJSON/WKT 字符串--wkt直接指定 WKT 字符串(覆盖 --input)--from / -f源坐标系--to / -t目标坐标系--format / -F输出格式:geojson / wkt / auto(默认 auto)--output / -o输出文件路径--list-crs列出所有支持的坐标系
CGCS2000 (4490) → WGS84 (4326):
bash
python3 scripts/coord_convert.py --wkt "POINT(113 23)" --from 4490 --to 4326
CGCS2000 (4490) → 投影坐标系 (4547):
bash
python3 scripts/coord_convert.py --wkt "POLYGON((112.58 26.56,112.60 26.56,112.60 26.58,112.58 26.58,112.58 26.56))" --from 4490 --to 4547
WKT 转 GeoJSON:
bash
python3 scripts/coord_convert.py --wkt "POINT(113 23)" --from 4326 --to 4490 --format geojson
GeoJSON 转 WKT:
bash
python3 scripts/coord_convert.py --input data.geojson --from 4490 --to 4326 --format wkt
WGS84 → 火星坐标系 (GCJ-02):
bash
python3 scripts/coord_convert.py --wkt "POINT(113 23)" --from 4326 --to gcj02
火星坐标系 → WGS84:
bash
python3 scripts/coord_convert.py --wkt "POINT(113 23)" --from gcj02 --to 4326
GCJ-02 → 百度坐标系 (BD-09):
bash
python3 scripts/coord_convert.py --wkt "POINT(113 23)" --from gcj02 --to bd09
BD-09 → WGS84:
bash
python3 scripts/coord_convert.py --wkt "POINT(113 23)" --from bd09 --to 4326
从百度坐标系的 GeoJSON 文件转换到 CGCS2000 投影坐标系:
bash
python3 scripts/coord_convert.py --input baidu_data.geojson --from bd09 --to 4547 --output result.geojson
--format 参数强制指定输出格式text
WGS84 (4326) ←→ GCJ-02 (火星坐标系) ←→ BD-09 (百度坐标系)
↑ ↑ ↑
└────────────────┼────────────────────┘
↓
CGCS2000 (4490)
↓
CGCS2000 分带 (4547-4556)