CityStats: figuring out what a "city" is
The current mapping of numeric ids to city names is in the form of a hash table in JD's PHP code. I've now written some code to build a new table in the db from that code, configured such that while there are many cases where the same id maps to different "versions" of a city name, due to spelling differences over the years and other reasons, our "preferred" version of the name is the first mapping in the db. That means we can look up any name and easily retrieve its canonical version along with its id. I'm still talking to JS-R about what the significance of the city names is; it's possible that there's info about the geographical extents of cities where they varied through the years. For instance, Ottawa (1961) becomes Ottawa-Hull (1971), which presumably means that its 1961 boundaries were changed to include Hull data. We may need to represent or explain this to the user.
Now I'm starting to look at tracts. What we need is a table while maps tracts to cities by year (in other words, it needs to have a row which contains the year, the city number, and the tract number for each distinct tract id in each city for each year. Table names can be constructed from this data (and I think it's going to be predictable where there are mc and tc tables, just based on year).