Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.9 KB

README.md

File metadata and controls

53 lines (36 loc) · 1.9 KB

Repository Description

This repository contains a Golang implementation which converts regular longitude and latitude coordinates to the Maidenhead Locator System and vice versa.

Based on the algorithm published by Edmund T. Tyson, N5JTY, titled "Conversion Between Geodetic and Grid Locator Systems" in QST January 1989, pp. 29-30, 43.

GoDoc Go Report Card Build Status

What is the Maidenhead Locator System?

The Maidenhead Locator System is a grid system which divides the earth in fields, squares, subsquares and extended subsquares. The extended subsquares could be split again in extended subsquares.

Example of Grid System

If we want the Maidenhead Locator string of Londen, it would be:

Field Square Subsquare Ext. Subsq.
IO 91 xm 02

How to use this Go module

Assuming you have set up a working instance of Go, using this module in your app is fairly easy

  1. Fetch this module
go get -u github.com/LighthouseLab/go-maidenhead
  1. Import the package and use the provided functionalities in your app. An example of a very basic app is shown below:
package main

import (
	"fmt"
	"os"

	"github.com/LighthouseLab/go-maidenhead"
)

func main() {
	// Converting coords to grid sq
	val, err := gridlocator.Convert(&gridlocator.Coordinates{48.858370, 2.294481})
	if err != nil {
		os.Exit(1)
	}
    fmt.Println(val)
}