So I haven't been on here for a while, huh? What's been happening? Not much. A lot. I don't know. Let's take it month-by-month. I suppose it's as good an approach as any. October was fairly standard and mostly uneventful. November and December were probably my favourite months in a very long time. January and February were a roller-coaster of very highs and very lows. March and April were pretty terrible, and no, it's (mostly) not related to that COVID-19 pandemic situation. Or at least I don't think so. All in all, I've come to the conclusion that I'll probably never really understand people, and I'm tired, and I'm not even sure I want to do "this" anymore.
Anyway, for the most part, I haven't touched this whole "*.chromic.org" environment since my last post in September. I don't think this post is indicative of a "return to a regular schedule". If things keep going this way, I don't think I'll have the energy/motivation to work on it much.
So what am I doing here rambling about some random nonsense then? I found a draft post I'd started almost a year ago, around the time I was messing with weather data and wrote the Weathered Radio post. I figured I'd get it done and, who knows, maybe I'm wrong and I'll start posting more. So let's cut the crap and get to it, shall we?
This post is very specific to the Environment and Climate Change Canada (ECCC)'s data, so might not be very interesting or relevant to many people, but as always, these posts are mostly about reminding me how my own stuff works.
The recurring theme on this blog is about self-hosting the data that I'm using. Unfortunately, I can't really go out and setup weather stations all over the place, so next best thing is to consume external data in a way that reduces the number of third-parties/tracking/etc.
In short, I have a small PHP script that takes a pair of latitude/longitude coordinates, finds the closest ECCC weather station and returns the current temperature.
This in itself isn't very interesting, but the process of collecting the weather station data was a fun exercise (an exercise that wouldn't have been necessary if they'd just provide an API... but hey, whatever.) It was also the first time (or one of the few times) using PostGIS, so that was also fun.
Most of the work is done via the import_sites.php script. It parses ECCC's "siteList" XML file, then fetches and parses each weather station's XML file to extract its location. It then inserts the weather station's information into the postgres database.
That's pretty much it. Pretty simple, turns out.