1

Looking for some PHP code to convert decimal lat and long to maidenhead locator/grid square.

I saw one answer on here for the match, but I think there was an error in it so I can't trust it. I am happy to work with the math if a ready-made PHP function does not exist.

Marcus Müller
  • 15,225
  • 22
  • 44
  • It would be helpful if you actually linked to the thing you don't trust and explain why. – Marcus Müller Jan 09 '17 at 01:34
  • http://ham.stackexchange.com/questions/221/how-can-one-convert-from-lat-long-to-grid-square?noredirect=1&lq=1 will have Java, Javascript, C, Clojure, Python (with and without PyHamTools), and Swift. That should have enough info to translate it to PHP... good luck! – Edwin van Mierlo Jan 09 '17 at 13:52
  • 1
    Possible duplicate of [How can one convert from Lat/Long to Grid Square?](https://ham.stackexchange.com/questions/221/how-can-one-convert-from-lat-long-to-grid-square) – rclocher3 Sep 05 '18 at 13:23

1 Answers1

2

A quick google turned up https://gist.github.com/magicbug/bf27fc2c9908eb114b4a, if that's not the one you don't trust. Looks pretty straightforward to me, though.

Also found http://www.levinecentral.com/ham/grid_square.php; there's an email address at http://www.levinecentral.com/ham/ where you could inquire about the source.

MoTLD
  • 726
  • 4
  • 12