GNOME Bugzilla – Bug 791402
Verify that <city> without <location> works as expected
Last modified: 2017-12-11 10:58:22 UTC
I pushed this change: commit d2c3ea2f994f14c5cf0b9a90bb74b61d9507e45b Author: Bastien Nocera <hadess@hadess.net> Date: Fri Dec 8 19:06:44 2017 +0100 locations: Allow a <city> not to have a <location> Which should hopefully mean that the nearest weather station would get picked up. But didn't verify that it's what would actually happen in the code.
Having this work would also allow us to remove a fair number of duplicate airport definitions, some of them having different ICAO codes for the same airport, and sometimes different coordinates. See commit 2142675dcee17b1d14ae2e6280aeb17cdb82075d. There's also a number of airports in Ireland defining and using Dublin airport.
I don't think that was ever supposed to be the case. The current code to choose a weather station will choose from the children of the city only. It's dangerous to close the airport that is closest to the city arbitrarily, as it could be in a different country or timezone. The geocode integration had this problem in the past, and in fact still has in certain cases. (Also, thanks for the many cleanups I saw fly by!)
Created attachment 365353 [details] [review] location: Make sure cities always have a weather station Following from changes to the locations database, we have a number of "major cities" without airports attached. Once the database has been filled up from the XML data, look for the closest airport in the same state or country and attach it to the city. https://bugzilla.gnome.org/show_bug.cgi?id=791402 See commit d2c3ea2f994f14c5cf0b9a90bb74b61d9507e45b
Attachment 365353 [details] pushed as 6d2b55b - location: Make sure cities always have a weather station