I have begun work on a new feature for the website that I’ve been thinking about for quite some time. Initially, it will be deployed in the United States only, but will gradually be spread to the rest of the world.
If you use the Browse button from the front page, select North America and then the United States, you can then pick any US state. In the upper left corner of the list of locomotives in that state you’ll see a little map of the state. For years, that has been a decoration, only. I thought it looked nice. Now, it actually links to something. If you click it now, you’ll get a large map of the state you’ve selected. In another day or so that map will be populated with markers pointing to each locomotive in that state.
I’ll talk more about it as I get some of the features finished.
Finished the remainder of the code for the mapping module, and am quite pleased with it. Localization works nicely. Made some enhancements to the Change logging stuff, and fixed a couple of things I missed on the last pass through.
It’s hard to believe that the end of June is already upon us. Today, on the programming front, I resolved several issues surrounding the “localization” issue discussed elsewhere and am almost finished with it. I should be able to move on to other things tomorrow.
Steve Frost, our European editor contributed information and photos regarding several locomotives in the UK today, and I did some research and updated records (and photos) for a couple of locomotives in Canada.
As always, the daily change report is available from the front page of the site, or from the link below:
No cute graphics today. I awoke this morning somewhat unmotivated and did some content research for Belgium over a couple of hours. Then I fixed a couple of minor issues in the Change Report/What’s New code.
I’ve now returned to the map subsystem localization issue and am making good progress. I’ll continue this, this evening.
A number of changes to the database, including the addition of previously unknown locomotives occurred today. As always, the daily change report is available below:
This morning as I began to look at the “localization” problem that affected our ability to present a nice “mapping” experience, I was confronted with 2750 locomotives with faulty localization data, 1720 where localization had failed and another 1030 where localization had never been attempted.
The utility that performs the localization task was rewritten. And now we are down to 296 locomotives with faulty localization data, and we have a good idea why, for each one. So yes. Happy. I am happy. Pikachu is happy. Progress is being made.
(I put Pikachu over there for my granddaughter, just so you know.)
Next task is to provide Editors with a tool to fix failed localization issues.
The method most commonly used to create a map to a locomotive’s location is called “geocoding”. In brief, we supply you with a map of the general area, you find the locomotive, drop a marker on it and we’re in business.
The problem with this idea, of course, is that we have to have the geographic coordinates (latitude and longitude) of a point somewhere vaguely in the neighborhood of our target locomotive. Usually this point is the “average center” of a geographic object, like a city. With 21,516 locomotives in our database, I can pretty well assure you that no one went through that list, found the middle of each city containing a locomotive, and then entered that into the locomotive’s record as its “localization coordinates”.
Rather a utility program was written to use the Google Maps Geocoding API to obtain these coordinates and enter them into the database. Now API is a term that is often bandied about, but seldom explained. It stands for Application Programming Interface. And what it means in the simplest possible terms is that a series of “functions” have been written to allow my computer to chat politely with your computer.
So when I returned to attack various issues with the website I became aware that there were 1720 locomotives (7.99%) in the database for which localization had failed and another 1030 (4.78%) for which localization had never been attempted. So naturally I brought out that little utility program I had written and used earlier and told it to go to work. And the thing failed on every single one of the 2750 locomotives it looked at. What?!? It used to work just fine. Why not now?
Several days of dread and avoidance ensued. I didn’t want to look at it, didn’t want to debug it. And finally I did. It took an hour to discover that Google had changed the API, so an additional parameter was required. And I fixed it, tested it and sat back grinning.
Today’s Programming Plans
I’m going to modify the localization utility so that when it encounters a location it cannot geocode it will log the location, the locomotive’s id and the failure code, so that I can investigate why this happened, and if necessary manually correct it.
I’m going to modify the admin routine that allows an editor to move a locomotive from one place to another, so that once the locomotive has been placed in its new location, localization is performed to make mapping possible.
Will also add a menu item that allows an editor to manually localize a locomotive.
With all that having been said, the daily change report is, of course, available at:
/What’s New? Which is connected to the silly oval button on the site’s front page, has changed rather dramatically. Try it. I think you might like it. Additionally, starting today we display the name of the editor who made the particular change so you know who to blame (or praise).
In other news, my next programming effort, beginning this evening will be considerable enhancements to the way maps are displayed and administered.
As always, today’s change report is available below:
Since I’ve been elbow deep in the part of the system that keeps records about what has happened to the content and information within the database that hold the locomotive records I have had occassion to visit the page behind the “What’s New” button on the home page, and I really don’t like that page. I don’t like the design, the layout, the way the information is presented or the assumptions it makes about what the user might want to know or not know about the contents of the database regarding “What’s New”.
So, I’m going to fix that over the next couple of days. Not going to patch up the existing page. I’m going to rewrite it from the ground up. I will make a demo version of it available as soon as I am far enough along to give all you nice site visitors something to criticize, ridicule or (unlikely) praise.
Over the past few days, I’ve been through all the operational locomotives in the United States, searching Youtube for clips we could use for each locomotive. We began with 890 video clips system wide, and today we ended up with 1193 clips, system wide a change of +303 videos. Was a lot of fun.
Now, onward and upward. Programming is in the offing for today. There are a few minor tweaks to the Change Reports module that I want to make. I want to add a Notes Added category, and I want to add Details Edited to the Change Log. Details Edited is currently only accounted for in the most recent change data and vanishes when it is superceded. And, as always, here’s a link to today’s Change Report: