Building A Weather App Using Go
At Ardan Studios (http://www.ardanstudios.com/) we have spent the last 6 months, in our spare time and on weekends, building a consumer based mobile application called OutCast (http://www.outcast.io/). The mobile application is tailored towards those who like spending time outdoors, whether that be fishing, hunting or any other type of activity.
This first release of OutCast shows the conditions for the buoy stations and marine forecasts areas within the United States. All this information is updated every 10 minutes and there are map views with traditional grids and search.
The backend processing for buoy and marine data is built using Go and running at Iron.IO (http://www.iron.io/) as a scheduled worker task. The buoy processing downloads a text file from the NOAA website and rips through it, updating MongoDB with any changes. The marine processing is a bit more complicated. This requires pulling down multiple web pages from the NOAA website and parsing out all the text. Go made building and running these tasks a breeze.
Another important aspect of OutCast is real time weather radar for the last 50 minutes. This has been very challenging on multiple levels. Mainly because we needed a real good image library that would run on Linux and could be integrated with Go. We were fortunate to find ImageMagick’s MagickWand C API and their Go package that provides the CGO bindings (https://github.com/gographics/imagick (https://github.com/gographics/imagick)).
Processing images is an intense piece of work. Sometimes it takes 3 seconds to clean a single image. With 155 radar stations that need to be processed every 5 minutes, it took us several refactors to get things working well. The MagickWand library can only handle processing one image at a time. This restriction places a lot of stress on getting things done accurately within an acceptable amount of time.
Here is a sample of a radar image before and after processing: