After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791402 - Verify that <city> without <location> works as expected
Verify that <city> without <location> works as expected
Status: RESOLVED FIXED
Product: libgweather
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: future
Assigned To: libgweather-maint
libgweather-maint
Depends on:
Blocks:
 
 
Reported: 2017-12-08 18:20 UTC by Bastien Nocera
Modified: 2017-12-11 10:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
location: Make sure cities always have a weather station (2.86 KB, patch)
2017-12-11 10:57 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2017-12-08 18:20:56 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.
Comment 1 Bastien Nocera 2017-12-08 18:23:21 UTC
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.
Comment 2 Giovanni Campagna 2017-12-08 19:55:15 UTC
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!)
Comment 3 Bastien Nocera 2017-12-11 10:57:12 UTC
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
Comment 4 Bastien Nocera 2017-12-11 10:58:18 UTC
Attachment 365353 [details] pushed as 6d2b55b - location: Make sure cities always have a weather station