Documentation ¶
Overview ¶
Package dxcc provides information about DXCC prefixes which are stored in a cty.dat file. The package also provides functions to download, store and update a cty.dat file. The default remote location for the cty.dat file is http://www.country-files.com/cty/cty.dat.
File Format Description ¶
First line information, fields are separated by ":" Column Length Description 1 26 Country Name 27 5 CQ Zone 32 5 ITU Zone 37 5 2-letter continent abbreviation 42 9 Latitude in degrees, + for North 51 10 Longitude in degrees, + for West 61 9 Local time offset from GMT 70 6 Primary DXCC Prefix (A "*" preceding this prefix
indicates that the country is on the DARC WAEDC list, and counts in CQ-sponsored contests, but not ARRL- sponsored contests).
Following lines contain alias DXCC prefixes (including the primary one), separated by commas (,). Multiple lines are OK; a line to be continued should end with comma (,) though it's not required. A semi-colon (;) terminates the last alias prefix in the list.
If an alias prefix is preceded by "=", this indicates that the prefix is to be treated as a full callsign, i.e. must be an exact match.
The following special characters can be applied after an alias prefix: (#) Override CQ Zone [#] Override ITU Zone <#/#> Override latitude/longitude {aa} Override Continent ~#~ Override local time offset from GMT
For detailed information about the file format see http://www.country-files.com/cty-dat-format/
For detailed information about handling of prefixes and suffixes see http://www.cqwpx.com/rules.htm
Index ¶
Constants ¶
const DefaultLocalFilename = ".config/hamradio/cty.dat"
DefaultLocalFilename is the default name for the file that is used to store the contents of cty.dat locally in the user's home directory.
const DefaultURL = "http://www.country-files.com/cty/cty.dat"
DefaultURL is the original URL of the cty.dat file: http://www.country-files.com/cty/cty.dat
Variables ¶
This section is empty.
Functions ¶
func LocalFilename ¶
LocalFilename returns the absolute path of the default local filename in the current user's home directory.
Types ¶
type CQZone ¶
type CQZone int
CQZone represents a CQ zone.
func ParseCQZone ¶
ParseCQZone parses the CQ zone information from a string.
type ITUZone ¶
type ITUZone int
ITUZone represents an ITU zone.
func ParseITUZone ¶
ParseITUZone parses the ITU zone information from a string.
type Prefix ¶
type Prefix struct { Prefix string Name string CQZone CQZone ITUZone ITUZone Continent string LatLon latlon.LatLon TimeOffset TimeOffset PrimaryPrefix string NeedsExactMatch bool NotARRLCompliant bool }
Prefix contains the information for one specific DXCC prefix. The information from the cty.dat file is denormalized: each specific prefix carries all the information associated with its primary prefix.
type Prefixes ¶
type Prefixes struct {
// contains filtered or unexported fields
}
Prefixes contains all DXCC prefixes.
func DefaultPrefixes ¶ added in v0.2.5
DefaultPrefixes returns the default Prefixes instance. It optionally loads the latest update on demand.
func LoadRemote ¶
LoadRemote loads a cty.dat file from a remote URL.
type TimeOffset ¶
type TimeOffset float64
TimeOffset represents a time offset to UTC.
func ParseTimeOffset ¶
func ParseTimeOffset(s string) (TimeOffset, error)
ParseTimeOffset parses the time offset information from a string.