The weather station data is sampled at each weather station, and forms our best estimate for the surrounding region’s weather.
So weather data is gathered at a point, but imputes information about a region. You can’t just slap each point down on coarse-grained tiles — the closest weather station might lie just over on the next quad, and you’re writing a check for very difficult calculations at run time.
We also have a severe version of the multiscale problem. The coverage varies wildly over space: a similar number of weather stations cover a single large city as cover the entire Pacific ocean. It also varies wildly over time: in the 1970s, the closest weather station to Austin, TX was about 150 km away in San Antonio. Now, there are dozens in Austin alone.
////I think readers will need for you to draw out what’s key here. Say why this matters. Connect the dots for readers. This is important for them to grasp. Amy////
These factors rule out any naïve approach to locality, but there’s an elegant solution known as a Voronoi diagram [1].
The Voronoi diagram covers the plane with polygons, one per point — I’ll call that the "centerish" of the polygon. Within each polygon, you are closer to its centerish than any other. By extension, locations on the boundary of each Voronoi polygon are equidistant from the centerish on either side; polygon corners are equidistant from centerishes of all touching polygons [2].
If you’d like to skip the details, just admire the diagram (REF) and agree that it’s the "right" picture. As you would in practice, we’re going to use vetted code from someone with a PhD and not write it ourselves.
The details: Connect each point with a line to its neighbors, dividing the plane into triangles; there’s an efficient alorithm (Delaunay Triangulation) to do so optimally. If I stand at the midpoint of the edge connecting two locations, and walk perpendicular to the edge in either direction, I will remain equidistant from each point. Extending these lines defines the Voronoi diagram — a set of polygons, one per point, enclosing the area closer to that point than any other.
<remark>TODO: above paragraph not very clear, may not be necessary.</remark>
Now let’s put Mr. Voronoi to work. Use the weather station locations to define a set of Voronoi polygons, treating each weather station’s observations as applying uniformly to the whole of that polygon.
Break the Voronoi polygons up by quadtile as we did above — quadtiles will either contain a piece of boundary (and so are at the lower-bound zoom level), or are entirely contained within a boundary. You should choose a lower-bound zoom level that avoids skew but doesn’t balloon the dataset’s size.
Also produce the reverse mapping, from weather station to the quadtile IDs its polygon covers.