import geopandas as gpd
from shapely.geometry import Point
#坐标转换的脚本,支持任何坐标的转换
# 要转换的4326标
x4326 = 13394266.8800
y4326 = 4333416.96
# 创建Geopandas的GeoDataFrame
gdf = gpd.GeoDataFrame(geometry=[Point(x4326, y4326)], crs="EPSG:3857")
# # 从EPSG:2000转换为EPSG:3857
# gdf = gdf.to_crs("EPSG:3857")
# 从EPSG:2000转换为EPSG:4326
gdf2 = gdf.to_crs("EPSG:4326")
#
# # 提取3857坐标
# x3857 = gdf.geometry.x[0]
# y3857 = gdf.geometry.y[0]
x4326 = gdf2.geometry.x[0]
y4326 = gdf2.geometry.y[0]
print("4326坐标:", x4326, y4326)
print("转换后")
# print("3857坐标:", x3857, y3857)
07-05
5627
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-09
818
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)