Neroth / gnome-shell-extension-weather

A simple extension for displaying weather informations from several cities in GNOME Shell
GNU General Public License v3.0
138 stars 143 forks source link

Not finding cities #168

Closed mightymouse2045 closed 10 years ago

mightymouse2045 commented 10 years ago

Hi,

Seeing as this is based on the Norwegian Meteorological Institute, why can I find certain cities on their site but can't find them when searching location in the extension?

From what I can see it isn't searching yr.no for cities. It gets the weather from that provider, but it appears that it is using gweather to search locations....?

I could be wrong but either way it's not working as it should.

Also how difficult would it be to change the provider from yr.no to a local provider that provides more specific information for my location? namely weather.com.ph

Could you possibly help me to customise it so I could do that?

mightymouse2045 commented 10 years ago

I rebuilt libgweather and added in the city and coordinates for Cabanatuan City, and it's working fine now. Perhaps you should look at using the API of yr.no directly rather than relying on libgweather for city searches etc.

libgweather is only up-to-date as they release new versions, and only if people update their install of libgweather, and cities are only updated if people from around the world open a bug request to add a new city, and if that city is confirmed to have over 200,000 people will it be included.... So basically it's not a very accurate method of obtaining the city locations at all.

Weather stations are all around the world regardless of whether or not the city or location has more than 200,000 people.

You'd be much better off getting the locations from yr.no which is much more comprehensive and is dynamically updated etc

svu commented 10 years ago

Do I understand it right that earlier versions did not use libgweather? If it is so broken (and lacks a lot of cities) - perhaps its usage could be made optional? Before, I was able to find Tralee, Ireland - now it is not there...

mightymouse2045 commented 10 years ago

I am still waiting on replies to my first two messages :S It's a nice extension, I just wish he's use an API direct from a weather site rather than libgweather - because it's next to useless with libgweather unfortunately

ferdnyc commented 10 years ago

Earlier versions of the extension by previous authors used hand-rolled data-retrieval code against other weather services, but they were written for previous versions of Gnome Shell (not 3.8 / 3.10 compatible) and lacked functionality that Neroth brought into the extension with the gnome-weather port. (City lookup, for one thing — previous generations required the user to enter their Location ID code into the settings, after manually looking it up elsewhere.) The forecast data was also more limited (today + 3 days, IIRC).

Regardless, that code is no longer part of the extension, so making libgweather optional today wouldn't solve anything — right now, if you turned off libgweather, you'd get no weather data. To make it "optional", alternative code would first have to be written that pulls from other sources.

If libgweather is an absolute dealbreaker, this fork is the one debian has migrated to, it uses Yahoo Weather last I looked.

mightymouse2045 commented 10 years ago

Yeah I think it is for me at least. As I said I had to rebuild it, and edit the code to get my city available. It worked and provided weather data from yr.no accurately (as far as I could tell), but on a recent upgrade I lost that and have to rebuild it again. The weather info for the closest available city to mine is off by 5 deg celcius.

yr.no have an api interface into their service don't they? Why couldn't you reconfigure to use their API instead of libgweather? I like the idea of getting my weather from Norway :P During the last typhoon (yolanda), the one that wiped out the centre of the Philippines, the information from yr.no was very accurate and their satellite images were very accurate as well (it looked and felt to me that they were more up to date than local satellite images and services).

For now I am switching to the fork you suggested, which is using openweathermap.org services

ferdnyc commented 10 years ago

See the discussion of issue #136 (especially towards the end) for some of the reasoning on that.

I don't speak for Neroth or anyone else and don't want to put words in anyone's mouth, but I think one concern is that everyone has their own favorite data provider (with their own particular reasons to recommend it over the other choices), and constantly rewriting to pull from the service du jour seems (IMHO) like kind of a waste of resources.

(The fork I mentioned is now using openweathermap.org, this month — up until a month ago they were using Yahoo Weather. So, who knows? Stick with it and in a couple of months maybe they'll scrap all the openweathermap.org request code and rewrite it again to pull from yr.no!)

All of those services provide a network API for data requests, but to access any of them all of the local request- and data-handling code ends up being implemented in JavaScript in the extension. libgweather provides a local calling API implemented in C++, so the extension can stay leaner and avoid having to reinvent the wheel.

As it exists today the libgweather library has some massive shortcomings (for some locations), yeah... and those should absolutely be fixed. In libgweather.