@ham2k/lib-arrl-data
v1.2.0
Published
ARRL data for amateur radio: sections, divisions and section lookup by state and county
Maintainers
Readme
lib-arrl-data
ARRL data for amateur radio: sections, divisions, and section lookup by state and county.
Installation
npm install @ham2k/lib-arrl-dataUsage
This library supports both ESM (ES Modules) and CommonJS formats.
import { findSection, findSectionCode, sectionsForState, ARRL_SECTIONS, ARRL_DIVISIONS } from '@ham2k/lib-arrl-data'
findSection('VT') // { code: 'VT', name: 'Vermont', divisionCode: 'NE', countryCode: 'US' }
findSection('MA', 'Suffolk') // { code: 'EMA', name: 'Eastern Massachusetts', ... }
findSection('MA') // null — Massachusetts spans two sections
findSectionCode('NY', 'St. Lawrence') // 'NNY'
sectionsForState('TX') // [ North Texas, South Texas, West Texas ]
ARRL_SECTIONS.EMA.name // "Eastern Massachusetts"
ARRL_DIVISIONS.NE.sectionCodes // ['CT', 'EMA', 'ME', 'NH', 'RI', 'VT', 'WMA']CommonJS:
const { findSection } = require('@ham2k/lib-arrl-data')Exports
findSection(state, county?)— theARRLSectionfor a state or province, ornullfindSectionCode(state, county?)— the same, as a section code stringsectionsForState(state)— every section covering any part of a state or provinceARRL_SECTIONS— all 71 US and 14 Canadian sections, keyed by codeARRL_DIVISIONS— all 16 divisions, keyed by codeSECTIONS_FOR_STATES— the raw state → section (or county → section) table
Lookups
findSection returns a single section or null. For states and provinces that hold more
than one section, the county is required — without it, or with a county that isn't
recognized, the result is null. Use sectionsForState to list the candidates instead.
County names are matched loosely: case, punctuation, whitespace and County / Parish /
Borough suffixes are ignored, and St. is treated as Saint.
Ontario is keyed on census divisions — counties, districts, regional municipalities and single-tier cities — since that is how RAC defines its four sections. Two of them, Muskoka and Kawartha Lakes, RAC does not name at all and are assigned by elimination; see data/NOTES.md.
Data
The county-to-section table was contributed by Tom Schaefer, NY4I. See data/NOTES.md for the corrections applied to it.
data/sections-for-states.json is the source of truth; run npm run generate after
editing it to rebuild src/data/sectionsForStates.ts.
TypeScript Support
Full TypeScript definitions are included: ARRLSection, ARRLDivision, SectionsForState.
