WXP version 5
Program Reference

WXPCITY

Sections

NAME

wxpcity - The WXP city database query program

SYNOPSIS

wxpcity [parameters...] value

PARAMETERS

Command Line Resource Default Description
-h help No Lists basic help information.
-df=filename default .wxpdef Sets the name of the resource file.
-na=name name wxpcity Specifies the name used in resource file parsing.
-ba batch No Run program in batch mode
-me=level message out2 Specifies level of messages to be displayed
  • text output - print
  • type labels (ID=) - out1
-fp=filepath file_path current directory Specifies location of database files.  All raw files used in this program are assumed to be in the file_path directory.
-in=input input city Specifies the input to the program:
  • city - the cities.raw file
  • cnty - the counties.raw file
  • zone - the zones.raw file
  • state - the states.raw file
  • dbase - the sao.cty city database file
  • input - a specific raw file
-ou=out[,out...] output all Specifies what type of output is to be printed. This is based on the columns in the raw file.  Here are some samples:
  • Name - the long name of the city,county,etc
  • Lat - the latitude of the place
  • Lon - the longitude of the place
  • ID - the 4 letter ID of the station (cities only)
  • WMO - the 5 digit WMO number of the station (cities only)
  • ST - the 2 letter abbreviation of the state
  • CN - the 2 letter abbreviation of the country (dbase only)
  • P - the priority of the station (dbase only)
  • Fip - the FIPs county number of the place
  • Zn - the forecast zone number of the place
  • ZWFO - the WFO responsible for zone forecasts
  • SWFO - the WFO responsible for state forecasts
  • WWFO - the WFO responsible for warnings
  • WFOs - all possible WFOs (states only)
  • Elev - the elevation
  • Pop - the population (county only)
  • Size - the size of the place (county only)
  • all - all possible data for a place

You can specify more than one type of output if types are separated by commas (Name,ID,ZWFO)

-cf=cityfile city_file None Specifies the name of the city database file used in finding station locations.  If specified, parsing will be done with specified city database file rather than raw files.  The dbase input option is automatically set.
-pa=param[,param...] parameter None Extra parameters:
  • first - print only first occurrence
value
type=value
value None This is the particular place/station to search for.  If none is specified, all places/stations are printed.  If one is specified, it tests it against the Name, the ID and the WMO number.  If the length of value is 4, it only checks the ID.  For example, if you want data for Denver, you can enter Denver, Denver_CO, KDEN or 72565 (if you are using dbase).

The value can specify what to parse against.  Each of the types of information can be parsed for by preceding the requested value with the type.  For example, to get all stations in Colorado, use ST=CO for value.

DESCRIPTION

This program can be used to get station information for either cities, counties or states based on plain English location names. The input to the program is either the name or the 2 or 4 letter ID for a particular city or state. The input name can be abbreviated as long as it uniquely defines the city, county or state desired. For example, to get information from Indianapolis or New York City:

   wxpcity Indianapolis
   Indianapolis 39.73 -86.27 KIND 72438 IN 097 047 KIND KIND KIND KIND 53 63 73 -5N

This will print all information about Indianapolis.  If there is a problem with a city or county name appearing in more than one state, you can append the state ID:

   wxpcity -in=cnty Marion_IN
   Marion 39.78 -86.14 IN 097 047 KIND KIND KIND KIND 53 63 73 797159 1026 

In this case, you cannot abbreviate the name.  It must be the complete name for the city or county. To get specific information, limit the output with the output resource.

   wxpcity -ou=zn Indianapolis
   047

For stations with more than one word, use the underscore "_" to separate all words.  

   wxpcity -ou=zwfo New_York
   KNYC

To get more than one piece of information out of the database:

   wxpcity -ou=Name,ID,ZWFO Indianapolis
   Indianapolis KIND KIND

The individual fields are separated by spaces that can be used in shell scripts as arrays:

   set stat=( `wxpcity Indianapolis` )
   echo $stat[3]

You can select data based on specific fields.  For example, you want all the stations from Indiana:

   wxpcity -ou=Name,ID,ZWFO ST=IN
   Evansville KEVV KIND 
   Fort_Wayne KFWA KIND 
   Indianapolis KIND KIND 
   Lafayette KLAF KIND 
   Muncie KMIE KIND 
   South_Bend KSBN KIND 
   Terre_Haute KHUF KIND 
   Bloomington KBMG KIND 
   Columbus KBAK KIND 
   Grissom KGUS KIND 
   Elkhart KEKM KIND 
   Gary KGYY KCHI 

The value "ST=IN" says to search for type state (ST) and all stations where state matches "IN".

NOTE: Remember that the program will match any value/name/ID that matched the specified characters.  If you don't specify a unique value/name/ID, more than one station will appear.   As a result, it is often better to use the 4 letter ID to specify a station.

NOTE: Remember to replace spaces in a city or county name with underscores "_".  Otherwise, the query may not work properly.

This program was developed to help with writing enhanced shell scripts where city and state names are known. This is especially important for finding WSFO and WSO offices for parsing forecast and advisory information.

FILES

SEE ALSO


Last updated June 8, 1998