https://github.com/8ff/maidenhead
This library provides an easy and convenient way to perform conversions between Maidenhead Grid Squares and latitudes and longitudes.
https://github.com/8ff/maidenhead
grid-square ham-radio maidenhead-locator
Last synced: 5 months ago
JSON representation
This library provides an easy and convenient way to perform conversions between Maidenhead Grid Squares and latitudes and longitudes.
- Host: GitHub
- URL: https://github.com/8ff/maidenhead
- Owner: 8ff
- License: agpl-3.0
- Created: 2023-02-03T22:00:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-27T18:11:21.000Z (almost 3 years ago)
- Last Synced: 2025-08-09T21:39:20.414Z (10 months ago)
- Topics: grid-square, ham-radio, maidenhead-locator
- Language: Go
- Homepage:
- Size: 1.69 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# maidenhead
This library provides an easy and convenient way to perform conversions between Maidenhead Grid Squares and latitudes and longitudes.
# Example
Ready to use example can be found in cmd/main.go
Alternatively, you can use the following code snippet:
```go
package main
import (
"fmt"
"log"
"github.com/8ff/maidenhead"
)
func main() {
// Convert lat/long to Maidenhead locator
locator, err := maidenhead.GetGrid(45.5231, -122.6765)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Grid: %s\n", locator)
// Convert Maidenhead locator to lat/long
lat, long, err := maidenhead.GetCoordinates("CN85pm")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Coordinates: %f, %f\n", lat, long)
}
```