我最近尝试使用 geopandas 和内置的世界文件来计算国家大小,但是我无法计算所选国家的正确大小。也许有人可以给我一个提示,告诉我在哪里犯了错?
尝试了不同的 shapefile(以及 geopandas 附带的世界文件),所有的文件都在 epsg: 4326 中。
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
cnames = ['Austria','Sweden','Kenya']
epsgs = ['3857','3395']
for c in cnames:
carea = world[world['name'] == c]
for e in epsgs:
carea = carea.to_crs(epsg=e)
area = int(pd.to_numeric(carea['geometry'].area)/10**6)
print(area)
期望结果为:
- 奥地利:83,879平方公里
- 瑞典:450,295平方公里
- 肯尼亚:580,367平方公里
我得到的实际结果为:
- 奥地利:187163
- 奥地利:186592
- 瑞典:2190160
- 瑞典:2187138
- 肯尼亚:595731
- 肯尼亚:591749
所以肯尼亚比较接近(也靠近赤道)?重新投影不正确吗?