I have a .csv (exported to .shp) database with about two thousand entries of points. One column in this database has certain values (e.g. a point can be 'ash tree', 'beech tree', 'elm tree', etc). I want to visualise their relative counts within polygons (provinces in this case) in a pie chart. I'd also like to adjust the size of the pie chart based on the total sum in that province, but I suppose this will be easy.

Using ArcGIS 10.1 for Desktop.

  • Have you searched this site for similar questions? What you are asking (Q1) is a common question, for example this Q&A will answer your question – Hornbydd Feb 14 '15 at 15:32
  • Thank you for replying. I have checked the site for similar answers. While using spatial join is an easy way to figure out Q1, it does not give the count per point column feature in a layer. Just the total number of points. And I'd personally like to refrain from using Python if there's an easier way. – Michael Feb 14 '15 at 15:46
  • Editing to make this a comment, since technically it's not part of the answer: The solutions are here in other questions, but you have a somewhat unique application case which requires picking parts from other solutions and combining them. You've also technically got two questions here which should be asked separately - summarizing the data and varying the size of the pie chart - but because they're intertwined I'll cover both. – Chris W Feb 14 '15 at 22:52

First, what you need to end up with is your polygon file with an attribute column for each value or tree species. It's important to note the for each part of that, because right now you have, and any summary method will generate, rows for each species and not columns. At some point you have to make that conversion.

Let's start with the points. Each point is a distinct tree with a given species, but we need to know how many are in each province. Intersect the points with the polygons, and now each point has an attribute that says which province it's in. This could also be accomplished with a Spatial Join.

We want a total of each species in each province, so run Summary Statistics, with both province name and species ID fields as CASE fields. While we don't need a STATISTIC field since the tool creates a frequency field in the resulting table with the count we need, the tool does require you specify one to run. You can use species ID with a COUNT method and that should end up with the same values as the frequency field. The resulting table is not tied to any geometry but should have one row for each unique province/species combination with a count of how many points have that combination.

Now the row/column problem. If you join this table as-is to polygons, you have a one to many relationship (multiple table rows match one polygon shape/row). It will pick the first match to display. If (and only if) you're working in a geodatabase and export the join results, you'll get a duplicate polygon for each row in the summary table, meaning one copy of the province for each tree (if not in a geodatabase and version less than 10.1 you need to use the Make Query Table tool and export the result for this). You can't generate a pie chart from that. Two possible solutions (there may be others):

  • Before joining, sort your summary table by species, and export each group of rows with the same species to a new table, then Join/Join Field all those individual tables to your polygon based on province ID. That will get you one row per province, and add a new column for each species count as you do each join.
  • Make your duplicate polygons as above. Run Union with your original polygon layer and your duplicate, stacked polygon layer as inputs. If done correctly this should result in one row/shape per province with a column for each species count. Note this will not work if you Union the stacked polygon layer to itself. The attribute table is likely to be messy and require some cleanup.

Now you have a single feature class with one row/record per province and an attribute for each species with a count. For the pie chart scaling you need to add one more field - tree total - and then Field Calculate the sum of all the other counts. From there you can create your pie chart symbols and vary their size as explained at Creating Pie Chart with radius based on another field? There are some other things about the pie charts noted there you may want to read through (such as not being able to label them, how many categories you can have and still be legible, etc.).

  • Thank you very much for your wonderful detailed answer! Worked like a charm with this. – Michael Feb 15 '15 at 11:16

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.