Author Topic: Weather Plugin Developer needs data entry help!  (Read 10405 times)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Weather Plugin Developer needs data entry help!
« on: August 24, 2013, 03:16:55 am »
Hello everyone,

I need your help.

In the pluto_main database, there are three tables, Country, Region, and City, which are ultimately used to find a particular city or town. I want the Weather device to use this data, to pick not only which weather data to display, but also which weather radar data to automatically select for display.

But for this to work, I need lots of data mapped.

Here is a list of all the maps that Weather.com offers from its map room.

https://96.226.245.101/work/maps.xml

Some of them are animated, some of them are static.

And these need to be mapped to countries and regions in the LinuxMCE database, so that when the Weather device looks at your installation, it will select the most appropriate maps to display.

Does anyone want to help? Yes, this is exceedingly tedious, and potentially thousands of mappings may need to be done, but in the end, it will allow for an ease of use and a "just works" functionality that everyone can appreciate.

I will point out, that not EVERY single city needs to be mapped, just the countries and regions.

I would be very indebted to those who help out, and help to make the weather functionality in LinuxMCE heads and shoulders above everything else out there!

Thanks for reading,
-Thom


bherbie

  • Veteran
  • ***
  • Posts: 54
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #1 on: August 24, 2013, 06:49:52 am »
Since I have found very few ways in which to give back to the community, I will volunteer my services for this task as it doesn't appear to require any specific technical skill.  Just let me know how you would like it done...

-herb

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #2 on: August 24, 2013, 08:07:00 am »
Thanks Herb! :)

Attached, I have an excel spreadsheet containing all 50 states for the US, as a starting test for this.

What needs to happen is this:

The maps.xml (https://96.226.245.101/work/maps.xml) needs to be read through with human eyes, and each map perused. You'll see that each map has at LEAST a static image, and maybe an animated set of images. If you open these up, for example:

http://image.weather.com/web/maps/radar/regions/us_rainfall_est_yesterday_600_en.jpg

You'll see the relevant map images. These will be pulled by the weather device to be presented on Orbiter. Some of them will be relevant for a state, some won't.

e.g.

Texas might want to see:

static_url1: http://image.weather.com/web/radar/us_sc_9regradar_plus_usen.jpg
animated_url1: http://images.weather.com/looper/archive/us_sc_9regradar_plus_usen/
static_url2: http://image.weather.com/images/maps/current/scen_cur_dew_720x486.jpg
animated_url2: <blank>
static_url3: http://image.weather.com/images/maps/current/sc_curtemp_720x486.jpg
animated_url3: <blank>
static_url4: http://image.weather.com/images/maps/forecast/scen_precfcst_600x405.jpg
animated_url4: <blank>
static_url5: http://image.weather.com/images/sat/regions/s_central_sat_720x486.jpg
animated_url5: http://images.weather.com/looper/archive/s_central_sat_720x486/
static_url6: http://image.weather.com/images/maps/pt_BR/special/severe_sc_720x486.jpg
animated_url6: <blank>
static_url7: http://image.weather.com/images/maps/winter/ski_scen_600x405.jpg
animated_url7: <blank>
static_url8: http://image.weather.com/images/maps/special/soilmoist_sc_720x486.jpg
animated_url8: <blank>
static_url9: http://image.weather.com/images/maps/travel/scen_trvlthun_720x486.jpg
animated_url9: <blank>
static_url10: http://image.weather.com/images/sat/regions/scen_vis_sat_720x486.jpg
animated_url10: <blank>
static_url11: http://image.weather.com/web/forecast/us_sc_9regwxhi1_large_usen_600.jpg
animated_url11: <blank>

you see? Take a look at each of those maps, and you'll get the idea. It turned out the South Central maps are relevant for Texas, but I'm willing to bet there are others relevant too. There are specific maps e.g. for California (smog alerts etc), and New York, etc., as well as airport maps etc..

Anything that is local to the given state, is relevant in this table. I will add additional maps that are relevant all over, but the hard part is trying to sort the regional stuff and pair it all together.

The key here, is that all of this be consistent. If there is no animated image, it should be left blank. only the base URL for the animated image should be used (as the filenames will always be the same), I can then take this data, and parse it into something I can manipulate.

Have a go, and if you have any questions, let me know. I'm here writing the code that will take what you've prepared, and utilize it.

Again, thanks. You're helping to make this plugin act like magic. :)

-Thom
« Last Edit: August 24, 2013, 08:12:15 am by tschak909 »

bherbie

  • Veteran
  • ***
  • Posts: 54
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #3 on: August 24, 2013, 04:35:32 pm »
Wow, there is a lot to sort through!  I am working on it but it is going to take sometime to complete - probably won't be done til tonight.  I am only using the base URL for the animated ones, let me know if you want that differently.

-herb

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #4 on: August 24, 2013, 06:54:18 pm »
yup, that's cool! thanks :)

-Thom

pointman87

  • Guru
  • ****
  • Posts: 171
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #5 on: August 24, 2013, 08:25:16 pm »
How do i see the country and city code in the database? If image.weather.com have maps of sweden (or maybe  scandinavia) i could try.

BR Daniel

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #6 on: August 24, 2013, 09:03:03 pm »
Look at the maps.xml I linked above.

I used the MySQL Workbench to export the following Queries

Code: [Select]
SELECT * from Country WHERE Description LIKE '%nited State%';

get the PK_Country #

Code: [Select]
SELECT PK_Region, FK_Country, Region from Region WHERE FK_Country = pk_country_number

this should give you a list of regions that you can export as a CSV, or Excel spreadsheet to work on. I added the static and animated fields up top simply as a reference.

If you're having trouble doing this, let me know and I'll prepare a spreadsheet for you.

-Thom

pointman87

  • Guru
  • ****
  • Posts: 171
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #7 on: August 24, 2013, 11:33:10 pm »
the first line gives me the countrycode  (752) but the second line gives me nothing, im using the countrycode in the end of the command. am i doing something wrong?

BR Daniel

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #8 on: August 24, 2013, 11:41:04 pm »
Code: [Select]
mysql> select * from Region WHERE FK_Country = 752;
+-----------+------------+---------------------+------+----------+
| PK_Region | FK_Country | Region              | Code | ADM1Code |
+-----------+------------+---------------------+------+----------+
|       770 |        752 | Sweden              | SE   |          |
|      3986 |        752 | Blekinge Lan        | BL   | SW02     |
|      3987 |        752 | Gavleborgs Lan      | GV   | SW03     |
|      3989 |        752 | Gotlands Lan        | GT   | SW05     |
|      3990 |        752 | Hallands Lan        | HA   | SW06     |
|      3991 |        752 | Jamtlands Lan       | JA   | SW07     |
|      3992 |        752 | Jonkopings Lan      | JO   | SW08     |
|      3993 |        752 | Kalmar Lan          | KA   | SW09     |
|      3994 |        752 | Dalarnas Lan        | KO   | SW10     |
|      3996 |        752 | Kronobergs Lan      | KR   | SW12     |
|      3998 |        752 | Norrbottens Lan     | NB   | SW14     |
|      3999 |        752 | Orebro Lan          | OR   | SW15     |
|      4000 |        752 | Ostergotlands Lan   | OG   | SW16     |
|      4002 |        752 | Sodermanlands Lan   | SD   | SW18     |
|      4003 |        752 | Uppsala Lan         | UP   | SW21     |
|      4004 |        752 | Varmlands Lan       | VR   | SW22     |
|      4005 |        752 | Vasterbottens Lan   | VB   | SW23     |
|      4006 |        752 | Vasternorrlands Lan | VN   | SW24     |
|      4007 |        752 | Vastmanlands Lan    | VM   | SW25     |
|      4008 |        752 | Stockholms Lan      | ST   | SW26     |
|      4009 |        752 | Skane Lan           | SN   | SW27     |
|      4010 |        752 | Vastra Gotaland     | VG   | SW28     |
+-----------+------------+---------------------+------+----------+

It is very possible that there may only be one map that encompasses Sweden, but, it's worth a look.

-Thom

pointman87

  • Guru
  • ****
  • Posts: 171
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #9 on: August 24, 2013, 11:50:17 pm »
thanks dude!

pointman87

  • Guru
  • ****
  • Posts: 171
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #10 on: August 25, 2013, 12:52:13 am »
i cant for the life of me find any good weather maps, would something like this do? http://upload.wikimedia.org/wikipedia/commons/0/0c/Blekinge_Municipalities.png
In case it do i can get all the countys.
 
BR Daniel
« Last Edit: August 25, 2013, 12:55:31 am by pointman87 »

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #11 on: August 25, 2013, 07:15:58 am »
No. Whatever is used, needs to be something similar to the maps.xml that I linked to in this thread. I see in there, at least Europe - Satellite, maybe some others may be relevant...

Some research may be needed to find a weather service that can feed us maps for your area.

-Thom

pointman87

  • Guru
  • ****
  • Posts: 171
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #12 on: August 25, 2013, 10:41:21 am »
Ok, i will get my looking-glass and keep up the search ;=)

BR Daniel 

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #13 on: August 25, 2013, 05:09:29 pm »
Did you already look through the maps in maps.xml (as in actually OPEN the pictures?)

-Thom

bherbie

  • Veteran
  • ***
  • Posts: 54
    • View Profile
Re: Weather Plugin Developer needs data entry help!
« Reply #14 on: August 25, 2013, 05:29:42 pm »
Here is what I have so far... still a lot to add.  I am only adding to states that appear in their entirety on each map.  I still need to comb back through and check for duplicates as it can get a little confusing when dealing with this much information.  Let me know if you want anything changed.

-herb