Can you add a new location

Asked by Backu on 2011-01-12

I'm a bit preturbed. I like the local weather availability, but it doesn't have MY location. Closest location is quite a bit to the west of me, and ALWAYS a different forecast/temperature. I've tried to add my location to the Locations.xml, but it always causes the applet to crash.

The requested location is:
Greeley, CO
Lat: 40.42N
Lon: 104.71W
Wx Zone: COZ043
ICAO Used: KGXY

I don't have any radar data, but it usually uses the same one as Fort Collins/Loveland.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu libgweather Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
GREG T. (ubuntuer) said :
#1

try weatherbug for linux .
http://weather.weatherbug.com/labs/linux.html

what i use with my lubuntu .

Revision history for this message
Backu (rtrum) said :
#2

Not an option. Last time I checked into WeatherBug, it was loaded with Spyware/Malware, so, no way am I going to risk it again.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Backu (rtrum) said :
#4

Still looking for assistance.
--- On Fri, 1/28/11, Launchpad Janitor <email address hidden> wrote:

> From: Launchpad Janitor <email address hidden>
> Subject: Re: [Question #141129]: Can you add a new location
> To: <email address hidden>
> Date: Friday, January 28, 2011, 3:24 AM
> Your question #141129 on libgweather
> in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/libgweather/+question/141129
>
>     Status: Open => Expired
>
> Launchpad Janitor expired the question:
> This question was expired because it remained in the 'Open'
> state
> without activity for the last 15 days.
>
> --
> If you're still having this problem, you can reopen your
> question either
> by replying to this email or by going to the following page
> and
> entering more information about your problem:
> https://answers.launchpad.net/ubuntu/+source/libgweather/+question/141129
>
> You received this question notification because you are a
> direct
> subscriber of the question.
>

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Backu (rtrum) said :
#6

I'm not letting this expire until someone gives me an actual plausible answer. 3rd party applications ARE NOT answers

--- On Mon, 2/14/11, Launchpad Janitor <email address hidden> wrote:

> From: Launchpad Janitor <email address hidden>
> Subject: Re: [Question #141129]: Can you add a new location
> To: <email address hidden>
> Date: Monday, February 14, 2011, 3:31 AM
> Your question #141129 on libgweather
> in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/libgweather/+question/141129
>
>     Status: Open => Expired
>
> Launchpad Janitor expired the question:
> This question was expired because it remained in the 'Open'
> state
> without activity for the last 15 days.
>
> --
> If you're still having this problem, you can reopen your
> question either
> by replying to this email or by going to the following page
> and
> entering more information about your problem:
> https://answers.launchpad.net/ubuntu/+source/libgweather/+question/141129
>
> You received this question notification because you are a
> direct
> subscriber of the question.
>

____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Backu (rtrum) said :
#8

*bump*
--- On Wed, 3/2/11, Launchpad Janitor <email address hidden> wrote:

> From: Launchpad Janitor <email address hidden>
> Subject: Re: [Question #141129]: Can you add a new location
> To: <email address hidden>
> Date: Wednesday, March 2, 2011, 3:40 AM
> Your question #141129 on libgweather
> in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/libgweather/+question/141129
>
>     Status: Open => Expired
>
> Launchpad Janitor expired the question:
> This question was expired because it remained in the 'Open'
> state
> without activity for the last 15 days.
>
> --
> If you're still having this problem, you can reopen your
> question either
> by replying to this email or by going to the following page
> and
> entering more information about your problem:
> https://answers.launchpad.net/ubuntu/+source/libgweather/+question/141129
>
> You received this question notification because you are a
> direct
> subscriber of the question.
>

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#9

You are definitely on the right track with editing the file /usr/share/libgweather/Locations.xml.

When you say that you changed the file and the applet crashes, most probably you messed up the structure by making a typo error when entering the new location .

I just played around and was able to create an entry for Greeley, and it worked.

To do:

Start gedit and create a file with the following contents (make sure it is one single line!)

s?<city><name>Gunnison</name>?<city><name>Greeley</name><coordinates>40.420000 -104.710000</coordinates><location><name>Greeley-Weld County Airport</name><code>KGXY</code><zone>COZ043</zone><radar>den</radar><coordinates>40.437417 -104.633222</coordinates></location></city><city><name>Gunnison</name>?1

Save that file as ~/Greeley.script

open a terminal window and enter this command

sudo sed -i.orig -f ~/Greeley.script /usr/share/libgweather/Locations.xml

Then restart the applet with

sudo killall clock-applet

you will see a warning box 'Clock has crashed', answer that box with 'reload'

If something fails you can restore the old Locations.xml by
sudo cp /usr/share/libgweather/Locations.xml.orig /usr/share/libgweather/Locations.xml
or by reinstalling the original package (sudo apt-get install libgweather-common --reinstall).

Please note that a new version of libgweather-common will most probably overwrite the Locations.xml file with a version without Greeley. To get Greeley provided in the official package you have to ask the developers to include that location. I am not sure where to place such request, maybe you have to go to the debian.org or gnome.org pages, because as far as I know Ubuntu receives new versions of that package from there.

Revision history for this message
Backu (rtrum) said :
#10

YAY! Worked beautifully. However, I had to readd the clock to my menu-bar for some reason. *shrug* Other than that, seemed to work perfectly. Thank you very much!

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

Happy to hear that it works!

When you say that you had to re-add the clock-menu, you most probably selected the wrong button at the warning 'clock has crashed' after the killall command. Apparently you were able to help yourself anyhow.

You have to be aware that every new version of libgweather-common will overwrite the patched Locations.xml file with an original version without Greeley. After such change you should be able to re-apply the 'sed...' command and it should work again.

You can also contact the developers and ask for adding you location to the official Locations.xml file.
To do that you can either:
Raise a bug against libgweather in Lauchpad
or
Raise a bug against libgweather in gnome.org
https://bugzilla.gnome.org/buglist.cgi?product=libgweather&component=locations

I guess providing the information
<city>
<name>Greeley</name>
<coordinates>40.414406 -104.771245</coordinates>
<location>
<name>Greeley-Weld County Airport</name>
<code>KGXY</code>
<zone>COZ043</zone>
<radar>den</radar>
<coordinates>40.437417 -104.633222</coordinates>
</location>
</city>
is all they need. (Note that I have corrected the city coordinates to the official (?) values provided by www.census.gov)