Usage:   Associated Places

NOTE: The HWaltplaces add-on is available that will allow most "place, state" combinations for the US.  It can be downloaded from http://www.hamweather.com/downloads/  

When trying to obtain your local zone forecast, you may find that HW cannot provide a forecast for for your town, but can for your county or for a near by city.  To understand why this happens you must first review how HAMweather offers the zone forecasts.

HW obtains the various text based forecasts from the National Weather Services (NWS) Interactive Weather Information Network (IWIN).  HW then parses these as needed and creates the various forecasts, with the zone forecast being the most popular. 

When you request the zone forecast, you supply a "place" and state.   HAMweather then obtains the text based zone forecasts for the state.  Then HW searches through the headers of the various zone forecasts for the "place" requested.  If the place is found then that zone forecast is parsed and outputted.   If the zone forecast is not found then you are prompted that the forecast was not available.  Often if you try anther city or the county name you will be able to obtain the wanted forecast.

This tends to work very well  most of the time, but for those times when there is not a near by city or the user does not know the county name it can be hard to obtain the wanted forecast.  This was one of the drawbacks with HW 1.x, but with HW 2.0 a fix to this has been given.  You can associate "places", so that the appropriate forecast is obtained.  For example:  If you want the forecast for Shawsville, Virginia, you will find that this towns forecast comes up unavailable.  The Montgomery County forecast,  of which Shawsville is located is is available. HW2 will allow you to associate the place "Shawsville" with "Montgomery" so that when someone requests the forecast for "Shawsville, VA" HW will obtain and output the forecast for "Montgomery County, VA".  Don't worry, HAMweather will still display "Shawsville" as the place name though.

Configuration

Since there is no web based administration yet for associated places you will have to do this the hard way.  Actually its not too hard, you will simply need to create and/or edit a few text files.  You create a separate text files for each state, thus allowing for different associations in the different states.  The naming convention for the text files is:

XX-altplaces.txt

Where XX is the two letter abbreviation for a state, in lowercase.  Thus the proper name for the Virginia associated places file would be:

va-altplaces.txt

In this file you will state your associations. 

The HAMweather distribution comes with a small smaple of Alt-place files, but HAMweather also offers an extensive set of alt place files for download.  This extensive set will add about 1.5 Meg of disk usage to your HW install though.  Visit the HW website for more information on the HWaltplaces  download.

INTERNATIONAL USAGE NOTE:  For non US altplace files the naming convention is ZZ-XX-altplaces.txt where ZZ is the countries two letter abbreviation and XX is the two letter abbreviation for the state. If you are not using state eqvialents then XX must be the two letter abbreviation for the country.   For example: For the altplace file for Ontario, Canada youwoulduse the name ca-on-altplaces.txt.  For a country not using states/provinces such as Italy you would use a name such as: it-it-altplaces.

Simple Associations

In the most basic form, you simply add associations using the equal sign (=).  For Example: To associate Shawsville with Montgomery County, simply add a line to the file that reads:

shawsville=montgomery

Notice that you do not need the word "county".  You can have  one associate per line, thus if I wanted to have two associations you would simply have them on separate line. For example:

shawsville=montgomery
salem=roanoke

INTERNATIONAL USAGE NOTE:  Since only zone forecasts are available for the US and Canada simple associations will not work for other countries. Also for canada there is an extra note: The place to the right of the equal must be the name of the html page to get the data from on Environmental Canadas web site, followed by "--" and then the associate place. For example:  A line in the Nova Scotia altplace file (names ca-ns-altplaces.txt) w=may have a line for Amherst which would look like:

amherst=fpcn11.whx.htm--CENTRAL|0

Where fpcn11.whx.htm is the html page to get the data from and CENTRAL is the associated place name to use when fetching the data from the page.

Advanced Associations

You can associate a place with another cities or even a weather zone.  Also you can have seperate associations for both the zone foreast and the hourly observations.  An advanced association files follows the following format:

RequestedPlace=AltZone|AltZoneCode|AltCurrent|AltCurrentCode

where:

Item Description
RequestedPlace Place the user requested forcast for
AltZone This can be either an alternate place name to use for the zone forcast or a weather zone number. INTERNATIONAL USAGE NOTE:   For Canada review notes in simple association section. For all countries except US and CANADA this field is not technically used since HW cannot provide zone forecasts for other countries. So for countries other than US and Canada simply put the requested place name here.
AltZoneCode This code is used to determine how the AltZone is applied.  It can be a number from 0 to 3.
Code Description
0 AltZone is a place name, output the RequestedPlace name in output
1 AltZone is a place name, output the AltZone name in output
2 AltZone is a Weather zone number, output the RequestedPlace name in output
3 AltZone is a Weather zone number, output the Weather Zone name in output

INTERNATIONAL USAGE NOTE:   For all countries besides the US set this setting to 0.

AltCurrent This can be either an alternate place name to use for the current conditions or a metar ICAO code to use to obtain the current condtions.

INTERNATIONAL USAGE NOTE:  For all countries besides the US only a metar ICAO code is supported.

AltCurrentCode This code is used to determine how the AltCurrent is applied.  It can be a number from 0 to 3.
Code Description
0 AltCurrent is a place name, output the RequestedPlace name in output
1 AltCurrent is a place name, output the AltCurrent name in output
2 AltCurrent is an ICAO code, output the RequestedPlace name in output
3 AltCurrent is an ICAO code, output the ICAO place name in output

INTERNATIONAL USAGE NOTE:   For all countries besides the US  only codes 2 and 3 are supported.

Following are some examples of what the advanced associations:

shawsville=montgomery|0|ronaoke|0

Note that you can have  one associate per line, thus if I wanted to have two associations you would simply have them on separate line. For example:

shawsville=montgomery|0|ronaoke|0
blacksburg=montgomery|0|KBCB|0

The association files go in the "us/states/info/" directory.  You will notice that all state info for all fifty states is included in these, this is because it allowed for simpler installation that having 50 separate directories.

Finally, if an association file does not exist for a state HAMweather will not fuss, for it will assume that there are not place associations and try to obtain the forecast for the "place" requested for.

NOTE: Currently the HAMweather Software package some predefined place  simple association files, thanks to Joe Torsitano,   but if you develop a file(s) that you believe would be useful to others send it to hamweather@hamweather.com and HAMweather, LLC will try to make it available for others.

Usage:   Associated Cities

Often times in the form input of "City, State" used with the "pands" parameter individual will just enter a city name.  HAMweather has the ability for you to create a cities association file for the major cities.  This file can be used to provide the correct city and state name for  a city, or place name.  The associated Cities are different from the Assocociated places in that associated cities only work when just a city name is requested and the associated cities file only supplies the appropriate city and state names which are then follow the normal processing (they then go through the normal associated places processing.)

Configuration

Since there is no web based administration yet for associated cities you will have to do this the hard way.  Actually its not too hard, you will simply need to create and/or edit a few text files.  There is one main Cities file it uses the following name

city-places-all.txt

If you tend to have a lot of associated cities then you can break the city-places-all.txt file into smaller files using the following naming convention:

city-places-X.txt

Where X is the letter that is the same as the First letter of all the Cities with-in it.  For instance the file name that would conatcin the City association for Ronaoke, Virginia would be:

city-places-r.txt

Note: That if a city name is not found in the individual lettered cit-plces file then it will search in the city-places-all.txt file.

INTERNATIONAL USAGE NOTE:  For non US altplace files the naming convention is ZZ-city-places-all.txt where ZZ is the countries two letter abbreviation. Thus u can have seperate city-places files for differnt countries.

Actual Associations

The actual associations are simple.  ther is one association per line as it follows the following format:

RequestedCity|ActualCity|ActualState|ActualCountry

where:

An example of a city associtation for Las Vegas would look like:

las vegas|las vegas|NV|us

This would allow the user to enter just the name Las Vegas with out the state. For HAMweather would find the state name from the Cities association file.

NOTE: Currently the HAMweather Software package some predefined place  simple association files, thanks to Joe Torsitano,   but if you develop a file(s) that you believe would be useful to others send it to hamweather@hamweather.com and HAMweather, LLC will try to make it available for others.

HAMweather copyright 2000 by HAMweather, LLC, all rights reserved