(╯°□°)╯︵ ┻━┻

Don't take life too seriously. You'll never get out of it alive.

Google Maps polygons with holes

The last couple of weeks I have been experimenting with Google Maps trying to draw filled polygons that look alright. I’m using matplotlib for making the polygons and I’ve figured out that the output from contourf(…) is like a plotting routine where you first get a polygon that should be filled with the current level and the following ones are holes in it. Before I just draw them all, coloring the holes with a lower color. This forced me to sort the polygons according to size which worked ok but didn’t look good.

Improving Google Maps polygons with b-splines

Google Maps is great, you get an extremely nice background map for free. I know that there are alternatives (Bing, OpenLayers, etc) out there but since I’m running Google App Engine it seems easier to go Google all the way. I’m plotting polygons and polylines (that’s what weather is about) and it works great but my input data is kind of sparse so the polygons look very rough. To improve them I’m using b-splines. Found a very nice article here. I just changed the javascript so it works with lat/lon-arrays and the output is an array of google.maps.LatLng.

Google App Engine ReferenceProperty and HTML5 local storage

The best thing with my job is that I work with the same things that I can spend hours doing in my free time. Too bad you don’t have 40 hours a week free time. It’s been a while but I have finally made som progress. I had some troubles with BigTable (the database that you use in Google App Engine). I put pretty large arrays with weather data in db.BlobProperty but when I read this back from the database GAE ran out of memory, even if I didn’t touch the blob. After reading up on this I found out that I had to use db.ReferenceProperty.

Progress report

I have successfully extracted some temperature data from the grib files, created a basic data model in Google App Engine and a very basic site in Django. I use matplotlib to create isolines that are drawn with Google Maps Api. It’t not that beautiful but there is room for improvement ;)

Weather and clouds

Ever since I wrote my master thesis I have had an interest in weather. My thesis was about metadata updates in a real time database at the Swedish Meteorological and Hydrological institute. The thesis was mainly about weather stations that deliver observations used when running weather models. After my thesis I ended up as a consultant but for the last 2,5 years I’m back at SMHI doing various work, mostly backend. I have worked with real time deliveries of weather along with processing, visualisation etc. I worked with Diana (diana.met.no), a weather workstation software developed by Met.no.