2

Is there an easy way in geopandas to calcuate polygon areas after an intersection analysis? I am switching from ArcGIS to open source and try to translate my code. In ArcGIS I used:

arcpy.AddGeometryAttributes_management("df1", "AREA", Area_Unit="HECTARES")
BERA
  • 72,339
  • 13
  • 72
  • 161
Benno_Banton
  • 67
  • 1
  • 6
  • Did you try the solution in this question? https://gis.stackexchange.com/questions/218450/getting-polygon-areas-using-geopandas – Piskr Oct 08 '19 at 10:52

1 Answers1

3

Use the area property of the geometry column:

import geopandas as gpd
df = gpd.read_file('/home/bera/someshapefile.shp')
df['area'] = df.geometry.area #/10000 for hectares
BERA
  • 72,339
  • 13
  • 72
  • 161