HamRadio v0.1.0 HamRadio.Grid View Source
Converts between coordinates and Maidenhead grid locators.
Link to this section Summary
Functions
Converts a grid square into a coordinate pair.
Converts a grid square into a coordinate pair.
Converts a grid square into the boundaries of its enclosing rectangle.
Converts a grid square into the boundaries of its enclosing rectangle.
Converts a coordinate pair into a grid square.
Converts a coordinate pair into a grid square.
Normalizes the string casing of a grid square.
Determines if a grid square is legit.
Link to this section Types
Link to this section Functions
Converts a grid square into a coordinate pair.
The coordinate is located at the center of the grid square.
Returns :error if the grid is invalid.
Converts a grid square into a coordinate pair.
Raises ArgumentError if the grid is invalid.
decode_bounds(grid)
View Sourcedecode_bounds(String.t()) :: {:ok, coord_bounds()} | :error
Converts a grid square into the boundaries of its enclosing rectangle.
Returns :error if the grid is invalid.
decode_bounds!(grid)
View Sourcedecode_bounds!(String.t()) :: coord_bounds() | no_return()
Converts a grid square into the boundaries of its enclosing rectangle.
Raises ArgumentError if the grid is invalid.
encode(coord, length \\ 4)
View Sourceencode(coord(), grid_length()) :: {:ok, String.t()} | :error
Converts a coordinate pair into a grid square.
The length can be 4 (default) or 6, returning grids like "FN32" or "FN32ab", respectively.
encode!(coord, length \\ 4)
View Sourceencode!(coord(), grid_length()) :: String.t() | no_return()
Converts a coordinate pair into a grid square.
Raises ArgumentError if the coordinates are invalid.
Normalizes the string casing of a grid square.
iex> HamRadio.Grid.format("fn32ab")
"FN32ab"
Determines if a grid square is legit.