Blog #8 – Beans!! (Pt. 2)
Last time, we took a look at the Canadian Agricultural Census to figure out how many beans are grown in Alberta. What we found is that a lot of bean data is suppressed, probably because there are a limited number of farms growing beans in Alberta, and they might get called out if they are the only farm growing beans in the division, exposing their hectare data to the world.
The bean related crops we extracted from the 2006 census were: white beans, other beans, peas, soybeans, chickpeas, lentils, and corn for good measure (not a bean, but I figured it could be a good backup). We have a couple of options; we could sum up all the available data and call it a day or focus in on the crop that has the most data available.
I figure the best bet is to focus on peas, and before you call me out, peas are beans too! (Yes, I had to Google it).
Peas have the least number of suppressed divisions for 2006, and a surprising number of hectares in each division, the most by far, which is probably why the data is not suppressed as much.
The next step is to take this pea data and connect it to the Alberta shapefile using the unique CDUID code we assigned to each division last time. This number is in the attribute table of the Alberta shapefile, and we use the ‘Join’ tool to put our external data into the shapefile’s table when the values match.
I popped into QGIS and pulled out the census division shapefile for all of Canada and clipped it to show divisions for Alberta only. In QGIS, Join is done in the properties window, which is different from ArcGIS. I joined the data, and it loaded into the Alberta attribute table, but I ran into a wall. The data joined as string data instead of as double data (i.e. letters instead of numbers). I was able to change this using the Refactor Fields tool, but for whatever reason, I couldn’t get the data to appear when I tried to change the symbology.
I’ll admit, I got frustrated when I looked up a solution and it went into a lot of Python code suggestions. I knew I could do this in two minutes in ArcGIS… so I did. I just wanted to see the map! It took no time to pop the shapefile I made in QGIS into ArcGIS and get into the symbology tab. I set the suppressed data to show as No Data and used the default natural Jenks categories to classify the hectare data. And voila!
Looking at the map, it’s easy to see why the data were suppressed, the mountains! There’s probably only one or two farms in these divisions that are growing beans. As mentioned last week, the division in the top right corner of Alberta was not included in the census at all. I imagine this is because there’s no agriculture there! Most of the peas are grown around the Calgary area, not too surprising, though I am surprised by the amount of peas grown in the northwest quadrant. Another useful way to make this map would be to normalize the data to the size of the division so we can get a sense of the relative amount of land used to grow peas. We can look into that another time. I kind of want to do corn too… and carrots… the classic trio. Let’s get into it next time!
Comments