I am using ArcGIS Desktop 10.4.1 to do my analysis.

I have a statewide dataset of plant community polygons identified by plant community type. I want to calculate the total acreage of each specific plant community type and export this information to a .csv table, with column 1 identifying each plant community type and column two identifying the total acreage.

I then want to calculate the acreage of each plant community type at smaller regional scales and export this data into column 3,4,5,... with the partial regional plant communities aligning with the originally exported statewide plant community rows regardless if the plant community doesn't exist in that region.


Example data

What is the process that I would take to make this happen?

  • One possibility: Dig a bit into SQL and build a virtual layer. – Erik Aug 1 '18 at 13:18
  • I dont understand what data you have, could you add a screenshot showing the attribute table of your dataset? Or some sample data would be even better. – BERA Aug 1 '18 at 18:36

Here is what I suggest (note that searching in the search tool bar of ArcCatalog will reveal many tools that do the things that you asked):

  1. Calculate Areas under toolboxes/system toolboxes/spatial statistics tools/calculate areas. a. As a source Use the feature that you have with the polys and plant types. b. Save the new feature into a gdb or if you are working out of a gdb then in that gdb but as another name such as plants_calc.
  2. Open the new feature created from step two and click drop down menu in upper right hand corner. Hide any fields that you don't want in your csv.
  3. Select all features to export. Locate a path, and save as a text file. Unhide all fields after.
  4. Go to location of saved text file from step 3 and change the file extension from .txt to .csv. Open. Or you can open excel and import data from text file and arrange it any way you desire. (Not sure why you need the csv if you have the feature already but this is the say to go about it).
  5. Generate a coverage file. Feature to coverage. Use the feature that was created in 1.b.
  6. For regions you'll use the Polygon coverage to Region tool. Under toolboxes/system tool boxes/coverage tools.tbx\data management\composite features\polygon coverage to region
  7. Use the coverage file that was built in step 5.
  8. You may have to piece together one file after you get all these files generated if that is what you want in the end. And you might also need to use the dissolve tool for some of the polygons.
| improve this answer | |

It is a bit unclear exactly what data you have. But you can use arcpy and the pandas module.

I assume you data is looking like this:

enter image description here

Then this should work:

import arcpy
import pandas as pd

arcpy.env.workspace = r'C:\folder\database.gdb' #Change
fc = 'Plants' #Change
fields = ['Community_ID','Region','Area'] #Change to match your data. Replace 'Area' with the name of you area column, probably 'Shape_Area' for a polygon feature class
out_table = r'X:\pivottable.csv' #Change

df = pd.DataFrame.from_records(data=arcpy.da.SearchCursor(fc,fields), columns=fields)

table = pd.pivot_table(data=df, values=fields[2], index=fields[0], columns=fields[1], aggfunc=sum, fill_value=0, 
                      margins=True, margins_name='State')

Output csv:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.