Tuesday, May 23, 2017

Visualizing Monarch Migration Data in QGIS

It has been some time since I took GIS, but I have been relearning to make basic maps in Quantum GIS, a free, open-source version of geographic information system mapping software.

I found a website that is posting citizen-science data on Monarch butterfly sighting from this spring. I took data from April and May and edited it a little bit in OpenOffice Calc.

The data are posted using www.learner.org. The link for the past 14 days of Monarch sightings is here at: JourneyNorth. The table should look like this when you open it:
The chart can be copied and pasted into OpenOffice Calc. If you don't want the first column to show, be sure to paste using the "Paste Special" tool, which allows you to hide the first column and just paste the data you want. Also, you'll want to paste the non-html text, otherwise it will try to paste the photos. When the data were how I wanted them, I saved the spreadsheet as a CSV file. Since I knew that monarchs start their journey from their hibernation location in the Oyamel fir stands of Mexico, I took a few lat/long points from that location and added it to my spreadsheet.
The data on the website also include more information if you click on them, with descriptions from the people who uploaded their sightings.

For QGIS, I found a base map of countries and borders, which I used as the backdrop and basis for the Monarch sighting data that I wanted to show. I used the standard 1984 projection.
Brown to blue-green shows a progression in the spring migration

Most sightings are of just a few monarchs. But there are a couple darker green spots that signify a lot of butterflies at one site.
To add the Monarch data, I used the tool called "Create a shapefile from CSV file", which allows me to take pretty much any spreadsheet data and, as long as I have lat/long coordinates, I can project them in QGIS. It's very handy.

Once I could view the data in GIS, I could right click on them in the legend on the software and choose Properties. This brings me to a window where I can choose an attribute such as Date or Number to classify and change the colors of the points according to the different values for each attribute. Unfortunately I don't remember yet how to choose a scale on my own for this, and so for the Dates I have a rather unattractive Legend in my final PDF map. I'll work on this.

The Print Composer allows me to design a share-worthy map with a title, legend, or a number of other aspects if I need them. I created two maps with the data so far--one with the Dates that the monarchs were first spotted by a citizen scientist, and the other with the number of monarchs spotted by a citizen scientist on one outing. It seems that the citizen scientists uploaded their numbers according to their discretion. One citizen might have just seen one and posted it, while another was out riding a horse around for several hours and counted all of the butterflies along their route.

There are a few errors in the above maps. When I get a chance I will fix them, but for now you should get the gist of what they have to say. Monarchs are moving north. Most people just see a few monarchs at a time. The 0 data point(s) should have been taken out for the Number of Sightings map. The points located in Mexico should be black, because they just show where the monarchs started out and do not represent real citizen science data points.

One thing to note is how impressive it is that these data were obtained from citizen scientists. There is a lot of potential with such projects. A similar set of maps could be made for bird migrations. The places where the most of a species is seen should be studied to see if there is something at those sites that should be replicated at other sites to improve the species's chance at survival.