<?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 the area of each landuse type for multiple buffers? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367485#M28998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;haha close enough &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 May 2014 03:34:49 GMT</pubDate>
    <dc:creator>TimBarnes</dc:creator>
    <dc:date>2014-05-19T03:34:49Z</dc:date>
    <item>
      <title>how to calculate the area of each landuse type for multiple buffers?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367479#M28992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a landuse polygon shape file, which include 8 types of landuse. From the polygon file, I find 100 points. I make a buffer for each point with 1 km. Now, I want to calculate the area (percentage) of landuse type for each buffer. how to write a python script to do this? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 18:25:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367479#M28992</guid>
      <dc:creator>JianyongWu</dc:creator>
      <dc:date>2014-05-14T18:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the area of each landuse type for multiple buffers?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367480#M28993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's the first strategy that comes to mind:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Use feature classes in a file geodatabase so every feature has its area automatically calculated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Make sure the data is in a projection with a meaningful unit of measure (e.g. meters, not degrees).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Clip the land use polygons to the buffer feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Iterate through the features in the buffer feature class, selecting each one and using that selection to select the overlapping, clipped landuse polygons in order to get the area values from them and calculate the percentages.&amp;nbsp; Ok, something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
buffers_path = "path\to\buffers"
clipped_land_use = "path\to\clipped\land\use"
land_use_fl = arcpy.MakeFeatureLayer(clipped_land_use,"lu")
for row1 in arcpy.SearchCursor(buffers_path):
&amp;nbsp;&amp;nbsp;&amp;nbsp; oid = str(row1.getValue("OBJECTID"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; area1 = row1.getValue("SHAPE_area") #presumably, this will be the same for each feature, because you have a standard buffer distance
&amp;nbsp;&amp;nbsp;&amp;nbsp; name = #get a name value from one of the fields if you want
&amp;nbsp;&amp;nbsp;&amp;nbsp; print name
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists("fl"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.management.Delete("fl")
&amp;nbsp;&amp;nbsp;&amp;nbsp; fl = arcpy.management.MakeFeatureLayer(buffers_path,"fl",'"OBJECTID" = "+oid)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.management.SelectLayerByLocation(land_use_fl,"INTERSECT",fl,"","NEW_SELECTION")
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; #now iterate through the selected clipped features and print the info
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row2 in arcpy.SearchCursor(land_use_fl):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; area2 = row2.getValue("SHAPE_area")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use = #get the land use type from whatever field it's in
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent = area2*100/area1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "&amp;nbsp; {0}: {1}%".format(use,str(percent))
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't tested this code, so there may be a bit of trouble shooting and configuring to do, but it should serve as a decent outline.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I only have 10.0, which is why I'm not using da.SearchCursor(), but this should work fine in 10.1/10.2 as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:03:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367480#M28993</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2021-12-11T17:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the area of each landuse type for multiple buffers?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367481#M28994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That is great. Thank you very much.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Here's the first strategy that comes to mind:&lt;BR /&gt;&lt;BR /&gt;1. Use feature classes in a file geodatabase so every feature has its area automatically calculated&lt;BR /&gt;2. Make sure the data is in a projection with a meaningful unit of measure (e.g. meters, not degrees).&lt;BR /&gt;3. Clip the land use polygons to the buffer feature class.&lt;BR /&gt;4. Iterate through the features in the buffer feature class, selecting each one and using that selection to select the overlapping, clipped landuse polygons in order to get the area values from them and calculate the percentages.&amp;nbsp; Ok, something like:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
buffers_path = "path\to\buffers"
clipped_land_use = "path\to\clipped\land\use"
land_use_fl = arcpy.MakeFeatureLayer(clipped_land_use,"lu")
for row1 in arcpy.SearchCursor(buffers_path):
&amp;nbsp;&amp;nbsp;&amp;nbsp; oid = str(row1.getValue("OBJECTID"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; area1 = row1.getValue("SHAPE_area") #presumably, this will be the same for each feature, because you have a standard buffer distance
&amp;nbsp;&amp;nbsp;&amp;nbsp; name = #get a name value from one of the fields if you want
&amp;nbsp;&amp;nbsp;&amp;nbsp; print name
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists("fl"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.management.Delete("fl")
&amp;nbsp;&amp;nbsp;&amp;nbsp; fl = arcpy.management.MakeFeatureLayer(buffers_path,"fl",'"OBJECTID" = "+oid)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.management.SelectLayerByLocation(land_use_fl,"INTERSECT",fl,"","NEW_SELECTION")
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; #now iterate through the selected clipped features and print the info
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row2 in arcpy.SearchCursor(land_use_fl):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; area2 = row2.getValue("SHAPE_area")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use = #get the land use type from whatever field it's in
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent = area2*100/area1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "&amp;nbsp; {0}: {1}%".format(use,str(percent))
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I haven't tested this code, so there may be a bit of trouble shooting and configuring to do, but it should serve as a decent outline.&lt;BR /&gt;I only have 10.0, which is why I'm not using da.SearchCursor(), but this should work fine in 10.1/10.2 as well.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:03:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367481#M28994</guid>
      <dc:creator>JianyongWu</dc:creator>
      <dc:date>2021-12-11T17:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the area of each landuse type for multiple buffers?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367482#M28995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad to hear that was helpful!&amp;nbsp; Be sure to mark the question as answered if you are satisfied.&amp;nbsp; Good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 13:08:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367482#M28995</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2014-05-15T13:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the area of each landuse type for multiple buffers?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367483#M28996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Glad to hear that was helpful!&amp;nbsp; Be sure to mark the question as answered if you are satisfied.&amp;nbsp; Good luck!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How to mark it? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 14:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367483#M28996</guid>
      <dc:creator>JianyongWu</dc:creator>
      <dc:date>2014-05-15T14:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the area of each landuse type for multiple buffers?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367484#M28997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the green check mark underneath the 0 at right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 14:44:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367484#M28997</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2014-05-15T14:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the area of each landuse type for multiple buffers?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367485#M28998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;haha close enough &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 03:34:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-area-of-each-landuse-type-for/m-p/367485#M28998</guid>
      <dc:creator>TimBarnes</dc:creator>
      <dc:date>2014-05-19T03:34:49Z</dc:date>
    </item>
  </channel>
</rss>

