Parsing online corona virus data into a map with Processing

Introduction:

I was inspired by a fellow South African developer who made an online map using data from the Pretoria University Data Science department. You can check it out here: https://coronamap.co.za

The actual data is from this GitHub repo here: https://github.com/dsfsi/covid19za – full credit to authors here: http://doi.org/10.5281/zenodo.3724083

They make data available in csv format, so the Processing code needed to parse that. Here is my code on Github: https://github.com/tomjuggler/parseCoronavirusSA

You can use Desktop or Android mode to run it.

How it works:

Although it is possible to use a real map for the background, I opted for an image since that saves time and bandwidth. The case information is parsed from the csv source and added up in an Array, sorted by province. *Update: there are now too many cases to track each one, the researchers are collating up to date provincial results here, I changed the source code to use that.

The numbers are inserted into the correct place, using a formula to account for resizing of the image (on Android, there are many different screen sizes and I wanted to have a full-screen image)

What’s next?

Processing code is basically Java, and it is not difficult to add to a “real” Android app, using Android Studio. I have included this map sketch as well as my virus spread simulator to a full Android Corvid-19 tracking app here:

https://circusscientist.com/CoronavirusSA.apk

Coming soon: source code and how to add your own Processing sketches to a proper Android Studio App, with a menu. Also: global data! I found a reliable source here for global data, lets use the data to track global results in Processing*!

*Update: I just started this repo here, initial code example using http requests to parse international data api from https://github.com/ExpDev07/coronavirus-tracker-api – only three countries so far but the code works at least!

Affiliate links are included on this website. Please support my future projects! Another way to support my work, and help yourself to free stuff at the same time, is to check out DigitalOcean with their promotional 2 months free hosting. If you haven’t yet heard of them, they are the best and cheapest virtual server on the market right now, use the link!