<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to calculate area for each feature in a Spatially Enabled Dataframe? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181982#M7479</link>
    <description>&lt;P&gt;you could just calculate in the shapefile first&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2022 17:37:40 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-06-10T17:37:40Z</dc:date>
    <item>
      <title>How to calculate area for each feature in a Spatially Enabled Dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181981#M7478</link>
      <description>&lt;P&gt;How does one calculate area for each feature in a Spatially Enabled Dataframe?&amp;nbsp; I read it in from a shapefile and need the acreage of each feature. I also would like to store the area as a new column.&amp;nbsp; This should be simple but I can't find a straight forward answer that works, I've referenced the &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/return-geodesic-area-from-spatial-dataframe-area/td-p/1169322" target="_self"&gt;two&lt;/A&gt; &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/field-calculating-geometry-attributes-in-arcgis/td-p/1096697" target="_self"&gt;similar&lt;/A&gt; posts. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sedf = pd.DataFrame.spatial.from_featureclass(myShapeFile)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Jun 2022 17:35:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181981#M7478</guid>
      <dc:creator>Josh-R</dc:creator>
      <dc:date>2022-06-10T17:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate area for each feature in a Spatially Enabled Dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181982#M7479</link>
      <description>&lt;P&gt;you could just calculate in the shapefile first&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 17:37:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181982#M7479</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-06-10T17:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate area for each feature in a Spatially Enabled Dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181984#M7480</link>
      <description>&lt;P&gt;Please excuse the simplified example. I'm doing a bunch geoprocessing beforehand that I'm not showing, so I would like an updated calculation. I can do it in arcpy no problem but I am curious if the arcgis api has a way to do it.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 17:45:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181984#M7480</guid>
      <dc:creator>Josh-R</dc:creator>
      <dc:date>2022-06-10T17:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate area for each feature in a Spatially Enabled Dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181990#M7481</link>
      <description>&lt;P&gt;You want to get a GeoSeriesAccessor and use &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.GeoSeriesAccessor.area" target="_self"&gt;its&amp;nbsp;area property&lt;/A&gt;, maybe pipe that into a new field.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sedf = pd.DataFrame.spatial.from_featureclass(myShapeFile)

gsa = arcgis.features.GeoSeriesAccessor(sedf['SHAPE'])

# add column using insert
sedf.insert(0, 'the_area', gsa.area, True)

# alternatively, just add a new column at the end of the sedf
sedf['the_area'] = gsa.area&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 17:55:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181990#M7481</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-06-10T17:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate area for each feature in a Spatially Enabled Dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181997#M7482</link>
      <description>&lt;P&gt;Exactly what I was looking for! Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 18:05:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1181997#M7482</guid>
      <dc:creator>Josh-R</dc:creator>
      <dc:date>2022-06-10T18:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate area for each feature in a Spatially Enabled Dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1182003#M7483</link>
      <description>&lt;P&gt;I found this answer helpful.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/return-geodesic-area-from-spatial-dataframe-area/m-p/1169346#M7351" target="_blank"&gt;Solved: Re: return geodesic area from spatial dataframe ar... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 18:25:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-calculate-area-for-each-feature-in-a/m-p/1182003#M7483</guid>
      <dc:creator>DavidAnderson_1701</dc:creator>
      <dc:date>2022-06-10T18:25:47Z</dc:date>
    </item>
  </channel>
</rss>

