---
name: "Ham::Locator"
section: "3pm"
platform: "linux"
package: "libham-locator-perl"
version: "0.1000-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Ham::Locator"
---

# Ham::Locator(3pm)

Convert between Maidenhead locators and latitude/longitude.

## NAME

Ham::Locator - Convert between Maidenhead locators and latitude/longitude.

## SYNOPSIS

```
  use Ham::Locator;
  my $m = new Ham::Locator;
  $m->set_loc('IO93lo');
  my ($latitude, $longitude) = $m->loc2latlng;
```

## DEPENDENCIES

- •

  Carp - for error handling

- •

  Class::Accessor - for accessor method generation

## CONSTRUCTORS

### Locator-\>new

Creates a new `"Ham::Locator"` object.

## ACCESSORS

### $locator-\>set\_loc(*locator*)

Sets the locator to use for conversion to latitude and longitude.

### $locator-\>set\_latlng((*latitude*, *longitude*))

Sets the longitude and latitude to use for conversion to the locator.

### $locator-\>set\_precision(*precision*)

Sets the number of characters of the locator reference to return when calling **latlng2loc**.

## METHODS

### $locator-\>latlng2loc

converts the latitude and longitude set by **set\_latlng** to the locator, and returns it as a string.

### $locator-\>loc2latlng

Converts the locator set by **set\_loc** to latitude and longitude, and returns them as an array of two values.

## CAVEATS

## BUGS

- •

  None, hopefully!

## COPYRIGHT

This module was written by **Andy Smith** \<andy.smith@netprojects.org.uk\>.

`$Id:` Locator.pm 10 2011-01-16 15:36:53Z andys $

(c)2009 Andy Smith (\<http://andys.org.uk/\>)

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
