Python中的数据转换:将兰伯特等角圆锥曲线转换为纬度和经度

问题描述 投票:0回答:1

Python中有没有一种通用方法可以将朗伯等角圆锥投影转换为经纬度(我假设是WGS84)?横向覆盖欧洲。

我的数据图如下所示:

enter image description here

我已经读到我可以使用该软件包

pyproj
。这是正确的吗?

编辑:

print(data.latitude[0:20,0:20])

<xarray.DataArray 'latitude' (y: 20, x: 20)>
array([[20.292281, 20.306942, 20.32158 , ..., 20.538402, 20.552673, 20.56692 ],
       [20.333665, 20.348339, 20.36299 , ..., 20.580011, 20.594295, 20.608555],
       [20.375059, 20.389747, 20.404412, ..., 20.621631, 20.635928, 20.650201],
       ...,
       [20.997195, 21.012085, 21.026951, ..., 21.247169, 21.261664, 21.276135],
       [21.038751, 21.053655, 21.068535, ..., 21.288954, 21.303462, 21.317946],
       [21.080317, 21.095234, 21.110128, ..., 21.330749, 21.34527 , 21.359767]])
Coordinates:
    step           timedelta64[ns] ...
    isobaricInhPa  float64 ...
    latitude       (y, x) float64 20.29 20.31 20.32 20.34 ... 21.33 21.35 21.36
    longitude      (y, x) float64 -17.49 -17.44 -17.4 ... -17.03 -16.98 -16.94
Dimensions without coordinates: y, x
Attributes:
    units:          degrees_north
    standard_name:  latitude
    long_name:      latitude
python latitude-longitude data-conversion
1个回答
0
投票

一个非常简单的方法是使用 geopandas

import geopandas as gpd

data = gpd.read_file(file_points_4839) #file in LCC epsg:4839
data = data.to_crs(4326) #reproject to epsg:4326 lat/lon    

数据集样本

EPSG:4839
   id                        geometry
0   0    POINT (123205.19 132829.099)
1   1   POINT (-90012.735 307220.008)
2   2  POINT (-89809.331 -165438.654)
EPSG:4326
   id                   geometry
0   0  POINT (12.30286 52.18136)
1   1   POINT (9.13536 53.75516)
2   2    POINT (9.25934 49.5047)
© www.soinside.com 2019 - 2024. All rights reserved.