A Go package to retrieve CQ Zone information (used in amateur radio) by geographic coordinates or zone number.
- Search by coordinates: get the CQ Zone for a given latitude/longitude pair.
- Search by zone number: retrieve details for a specific CQ Zone (1–40).
- GeoJSON export: get the full GeoJSON FeatureCollection of all CQ Zones.
go get github.com/logocomune/go-cq-zone// GetZoneByCoordinate returns the CQ Zone containing the given coordinate.
// Returns false if the coordinate is out of bounds or matches no zone.
func GetZoneByCoordinate(c Coordinate) (CqZone, bool)
// GetZoneByNumber returns the CQ Zone with the given number (1–40).
// Returns false if the number is out of range.
func GetZoneByNumber(id int) (CqZone, bool)
// GetGeoJSON returns a GeoJSON FeatureCollection of all 40 CQ Zones.
func GetGeoJSON() FeatureCollectionpackage main
import (
"fmt"
"github.com/logocomune/go-cq-zone"
)
func main() {
zone, found := cqzone.GetZoneByCoordinate(cqzone.Coordinate{Lat: 43.71, Lng: 11.75})
if !found {
fmt.Println("Zone not found")
return
}
fmt.Println("CQ Zone:", zone.Number)
fmt.Println("Name: ", zone.Name)
fmt.Println("Center: ", zone.Center)
}zone, found := cqzone.GetZoneByNumber(15)
if !found {
fmt.Println("Zone not found")
return
}
fmt.Println("Name:", zone.Name)fc := cqzone.GetGeoJSON()
// fc is a GeoJSON FeatureCollection with all 40 zones.Special thanks to @HB9HIL for providing the GeoJSON files of CQ Zones via their repository: hamradio-zones-geojson.
This project is distributed under the MIT License. See the LICENSE file for more details.