I have mentioned a few times (most recently at Find that maidenhead grid locator for an address) about Maidenhead Grid Square Locators and my desire to have them as part of the log for each contact. It helps show distance as well as for mapping and just overall complete information on a contact.
The QRZ.com page that allows you to enter an address and calculate a grid locator hasn’t worked for half a year despite multiple requests to have someone look into it. Someone recently suggested using APRS.fi to do it and that works fine. But in the end I decided to write my own, which probably took more time to find the right formulas to convert between lat/long and the grid square then to code the actual page.
At http://www.levinecentral.com/ham/grid_square.php is the web page I put together. You can enter in an address or a call sign. If a call sign is entered, I pull address info from QRZ.com and the process continues from there. The address is then processed by Google and it comes back with either a latitude/longitude for that address or that it didn’t find anything. If Google doesn’t find a hit, I start stripping the address down piece by piece and try again.
Once a hit is found I calculate the grid square based on the latitude and longitude returned by Google. I place a map point at that location (usually the location specified or associate to the call sign) with the info as well as the grid location displayed at the top of the page for quick reference. If the address was manipulated, the address which returned results is displayed. I then can calculate one of the corner points for the maidenhead grid square locator border and draw a rectangle that represents the area for the grid square the location is within.
There is nothing very magical about the page but I wanted something to do what I needed and how I wanted it done so what better way to get that then writing it yourself! The current Google mapping framework I use is the same as used by the Repeater Mapping pages which is great for getting something built quickly. Depending on how much more I might want to add to this page, I might need to use a different Google toolset or deal with the Google API directly.