Aller à la page: 1 - 2 [+1]

Fin
Canadian Cities
  • Envoyé: 10.02.2004, 10:10
     
    dr.tech
    enregistré depuis:
     février 2004
    Status:
    hors ligne
    dernière visite:
    02.09.05
    Messages:
    10
    I love your module.

    I can not access Canadian cities outside of Quebec. Quebec is the only province that appears in the Subdivision category.

    I checked the database and Nova Scotia (my province) is there, so that is not the problem.

    Thanks
  • Envoyé: 10.02.2004, 10:40
     
    dr.tech
    enregistré depuis:
     février 2004
    Status:
    hors ligne
    dernière visite:
    02.09.05
    Messages:
    10
    I changed the default subdivision code to 106 in canada.php and it now picks up Nova Scotia cities ... did not try other provinces.
  • Envoyé: 10.02.2004, 21:12
       
    vedrine
    rang:
    Site Admin Site Admin
    enregistré depuis:
     décembre 2003
    Status:
    hors ligne
    dernière visite:
    12.05.08
    Messages:
    257
    Oh yes I have a big problem with Canada.
    When I try to get the codes from MSNBC or weather.com the country code for ALL canadians cities is CAXX
    But in the module as there is hundreds of cities, Canada is splitted in several "subdivisions" (I'm not very good at geography but I suppose these subdivisions match some administrative subdivisions : "provinces" or something like that)
    Namely when I took the module, the folowing subdivisions where already defined :
    Northwest Territories
    Northern Territory
    Nova Scotia
    Ontario
    Prince Edward Island
    Quebec
    Saskatchewan
    Yukon Territories
    British Columbia
    Alberta
    New Brunswick
    Newfoundland
    Maybe I forgot some of them they are in pninit.php.
    So what I need is someone to put the right cities in the right files. Obviously :
    - this is a very time consuming tast
    - it's easier to do for a canadian people than for a "frenchy"
    So I took the decision to release the file "as is" but I needed to put the cities in one subdivision, I choose Quebec (don't forget i'm french icon_wink )
    so the quicker way is what you have done : change the subdivision number
    but the long term solution is that somebody accept the task of cleaning canadian file, splitting it among subdivisions files and creating several files that could be called NorthwestTerritories.php, NovaScotia.php, ... each one with a different $subdiv_id = ... line
    Anybody interested ??
  • Envoyé: 11.02.2004, 00:20
    Invité
    rang:
    1
    enregistré depuis:
     décembre 2003
    Status:
    hors ligne
    dernière visite:
    06.03.05
    Messages:
    0
    I got packages with the old ACID codes for I believe all the canadien provinces. They work, at least most of the Ontario ones. There are some ACIDs that MSNBC dropped.
    If someone could tell me a place to upload them I gladdy will do so. The download on my site doesn't work yet.

    rb
  • Envoyé: 11.02.2004, 00:42
     
    dr.tech
    enregistré depuis:
     février 2004
    Status:
    hors ligne
    dernière visite:
    02.09.05
    Messages:
    10
    If you want, PM me and I'll give you my email address. I could put them up as a zip file if you send them to me.

    Perhaps vedrine would like to add them to his site.
  • Envoyé: 11.02.2004, 01:09
       
    vedrine
    rang:
    Site Admin Site Admin
    enregistré depuis:
     décembre 2003
    Status:
    hors ligne
    dernière visite:
    12.05.08
    Messages:
    257
    In europe the old codes cessed to work approx 3 months ago. I will not be very surprised that it will be the same shortly for other countries. But if you have the old codes maybe we can use them to automate the process of making the new files (at least partialy because of course some cities were removed in the code change process in a lot of countries so I suppose it was the same in Canada). Please send me the files and indicate what provinces you need first (Nova Scotia, Ontario).
    you can send them to vedrine@vedrine.net
  • Envoyé: 11.02.2004, 01:30
    Invité
    rang:
    1
    enregistré depuis:
     décembre 2003
    Status:
    hors ligne
    dernière visite:
    06.03.05
    Messages:
    0
    Well first of great work, finally a weather module or version there of that works.
    One problem I seem to have is either the MSNBC feed is lagging so far behind or they predict weather different than other weather stations since their forcast is off ,quite a bit, compared to 3 other sources, theweathernetwork.com, environment canada and the source the feed that HamWeather uses.
  • Envoyé: 11.02.2004, 08:14
     
    dr.tech
    enregistré depuis:
     février 2004
    Status:
    hors ligne
    dernière visite:
    02.09.05
    Messages:
    10
    The weathernetwork.com provides cites broken down by provinces and has the most cities/towns/villages of all of the sites.

    http://weather..../indexNS.htm is an example.

    I don't think they use the accid codes. Is there any way to modify this module to work with trheir system?

    Great discussion .. thanks
  • Envoyé: 11.02.2004, 10:16
       
    vedrine
    rang:
    Site Admin Site Admin
    enregistré depuis:
     décembre 2003
    Status:
    hors ligne
    dernière visite:
    12.05.08
    Messages:
    257
    Let me explain some of the problems involved in getting weather data
    1)We can't get them from a web page because it would be very difficult to harvest the html code and it would break very frequently : we would have to modify the code at each minor changes in the page layout.
    So we get them in very special form that the program can decode easily
    - MSNBC send data like this :
    this.swCity = "Nantes"; this.swSubDiv = ""; this.swCountry = "France"; this.swRegion = "West Europe"; this.swTemp = "34";
    and so on ...
    - weather.com send them in XML form :
    <loc id="FRXX0059">
    <dnam>Marseille, France</dnam>
    <tm>9:39 PM</tm>
    <lat>43.45</lat>
    <lon>5.22</lon>
    <sunr>8:09 AM</sunr>
    <suns>5:28 PM</suns>
    <zone>1</zone>
    </loc>
    and so on ...
    It is possible to add to the program others methods of getting the data if we know how to query the data source and how to decode the answer. For MSNBC this was done years ago by somebody. For Weather.com it was easy for me because when you subscribe to their XML feed you can download a user guide and all the system is completely described.
    If weather.ca has such a system available, it is possible to use it (but the fact that they don't use the same code as MSNBC and weather.com will obviously be a problem, as we will need to add another field in the database for this code)
    2) The "canadian problem" for me is that I don't have an automated way of building the provincial files.
    I tried this morning to do a little file for Ontario (as I don't know anything on Ontario cities, I must have missed a lot, I hope main ones are here !):
    Code
    &lt;?php

    $city_name = 'Ontario';
    $city_version = 1.0;
    $subdiv_id = 111;
    $country_id = 15;
    $region_id = 4;
    $city_data = array&#40;&#41;;

    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0025', 'name' =&gt; 'Barrie'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0628', 'name' =&gt; 'Earlton'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0113', 'name' =&gt; 'Delhi'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0159', 'name' =&gt; 'Geraldton'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0213', 'name' =&gt; 'Kapuskasing'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0218', 'name' =&gt; 'Kenora'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0225', 'name' =&gt; 'Kingston'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0255', 'name' =&gt; 'London'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0308', 'name' =&gt; 'Moosonee'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0326', 'name' =&gt; 'North Bay'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0343', 'name' =&gt; 'Ottawa'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0356', 'name' =&gt; 'Petawawa'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0582', 'name' =&gt; 'Port Weller'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0606', 'name' =&gt; 'Red Lake'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0441', 'name' =&gt; 'Sarnia'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0443', 'name' =&gt; 'Sault Ste Marie'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0457', 'name' =&gt; 'Simcoe'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0603', 'name' =&gt; 'Sioux Lookout'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0482', 'name' =&gt; 'Sudbury'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0498', 'name' =&gt; 'Thunder Bay'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0501', 'name' =&gt; 'Timmins'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0504', 'name' =&gt; 'Toronto'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0508', 'name' =&gt; 'Trenton'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0532', 'name' =&gt; 'Wawa'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0541', 'name' =&gt; 'Wiarton'&#41;;
    $city_data&#91;&#93; = array&#40;'accid' =&gt; 'CAXX0546', 'name' =&gt; 'Windsor'&#41;;

    ?&gt;

    It took me more than an hour to make this small file !!
    Sop I must either find a lot of volontaires or a better way !!
  • Envoyé: 11.02.2004, 10:44
     
    dr.tech
    enregistré depuis:
     février 2004
    Status:
    hors ligne
    dernière visite:
    02.09.05
    Messages:
    10
    I extracted the ones for Nova Scotia. I think I got them all but might have included one that doesn't belong (Barachois)

    <?php
    /*************************************************************************/
    /* PLEASE READ : I found this package on a forum */
    /* As the number of cities is important, I would be necessary to split */
    /* it acording to canadian provinces. This subdivisions are already */
    /* in the module tables. But this can only be done by a person */
    /* wuth a good knowledge of the canadian geography. Please if you do it */
    /* send it back so that others users can enjoy your work */
    /*************************************************************************/

    $city_name = 'Canada';
    $city_version = 1.0;
    $subdiv_id = 106;
    $country_id = 15;
    $region_id = 4;
    $city_data = array();

    $city_data[] = array('accid' => 'CAXX0008','name' => 'Amherst');
    $city_data[] = array('accid' => 'CAXX0024','name' => 'Barachois');
    $city_data[] = array('accid' => 'CAXX0032','name' => 'Bedford');
    $city_data[] = array('accid' => 'CAXX0107','name' => 'Dartmouth');
    $city_data[] = array('accid' => 'CAXX0111','name' => 'Debert');
    $city_data[] = array('accid' => 'CAXX0120','name' => 'Dominion');
    $city_data[] = array('accid' => 'CAXX0130','name' => 'Elmsdale');
    $city_data[] = array('accid' => 'CAXX0162','name' => 'Glace Bay');
    $city_data[] = array('accid' => 'CAXX0177','name' => 'Greenwood');
    $city_data[] = array('accid' => 'CAXX0183','name' => 'Halifax');
    $city_data[] = array('accid' => 'CAXX0219','name' => 'Kentville');
    $city_data[] = array('accid' => 'CAXX0269','name' => 'Maitland');
    $city_data[] = array('accid' => 'CAXX0287','name' => 'Middleton');
    $city_data[] = array('accid' => 'CAXX0317','name' => 'New Waterford');
    $city_data[] = array('accid' => 'CAXX0327','name' => 'North Sydney');
    $city_data[] = array('accid' => 'CAXX0360','name' => 'Point Edward');
    $city_data[] = array('accid' => 'CAXX0592','name' => 'Shearwater');
    $city_data[] = array('accid' => 'CAXX0470','name' => 'Springhill');
    $city_data[] = array('accid' => 'CAXX0487','name' => 'Sydney');
    $city_data[] = array('accid' => 'CAXX0488','name' => 'Sydney Mines');
    $city_data[] = array('accid' => 'CAXX0510','name' => 'Truro');
    $city_data[] = array('accid' => 'CAXX0534','name' => 'Wedgeport');
    $city_data[] = array('accid' => 'CAXX0556','name' => 'Yarmouth');

    ?>

    There are gaps in a few areas of the province (I don't think there are MSNBC codes for them). That's why I was hopeful of including them.

    cheers

Aller à la page: 1 - 2 [+1]

Réponse rapide
 
  • Options
Code:
Couleur de la police:  
Taille de la police: