<p>geopandas面积计算的最重要部分是必须使用对应于<code>equal-area</code>投影的CRS。在这种情况下,简单的<code>cylindrical equal-area projection</code>(epsg=6933)很好使用</p>
<p>数据文件可从以下位置获得:-<a href="https://www2.census.gov/geo/tiger/TGRGDB20/tlgdb_2020_a_us_areawater.gdb.zip" rel="nofollow noreferrer">data_source</a></p>
<p>相关代码应为:</p>
<pre><code>water = gp.read_file("/Users/user/Downloads/tlgdb_2020_a_us_areawater.gdb")
# check the CRS
water.crs
# you should find that it is already `epsg=4269`
# select some rows of data
lakeSup = water.loc[water['FULLNAME'].str.contains('Lk Superior', na=False)]
# lakeSup = lakeSup.to_crs(epsg=4269) # already is
# convert CRS to equal-area projection
# the length unit is now `meter`
eqArea_lakeSup = lakeSup.to_crs(epsg=6933)
# compute areas in sq meters
areas = eqArea_lakeSup.area
# set the area units to sq Km.
# and add it as a new column to geodataframe
eqArea_lakeSup["area_sqKm"] = areas.values/10e6
# print some result
print(eqArea_lakeSup[["FULLNAME","area_sqKm"]].head(10))
</code></pre>
<p>输出:</p>
<pre><code> FULLNAME area_sqKm
233938 Lk Superior 0.695790
629973 Lk Superior 181.784389
629974 Lk Superior 36.563379
629975 Lk Superior 303.028792
629976 Lk Superior 446.529784
629977 Lk Superior 30.418959
629978 Lk Superior 45.785750
629979 Lk Superior 621.004141
629980 Lk Superior 86.142490
629981 Lk Superior 30.186412
</code></pre>