GridLocW - a Lat/Long to Maidenhead converter for Windows - with optional GPS support { GridLocW : Grid Locator (for) Windows } { Name derived from the various versions of Gridloc around on the web - most of which are DOS or BASIC (eg GWBASIC) releases } ----------------------------------------------------------------------------------------------------------
A side issue from operating in the 2009 John Moyle Field Day was the fact that some operators - particularly home stations - did not know their (maidenhead) grid squares. To make it easier for any future field days, I wrote GridLocW - Grid Locator (for) Windows - in the pascal-based environment of "Delphi". That way, provided they can give me a latitude and longtitude, I can calculate it for them via software loaded on the logging PC - and then tell them as well - as using it in the log itself. Of course, it has a side benefit for any field day operators in that it has internal GPS support that can tell them exactly what grid square they are in - all they need to do is connect a suitable GPS to the PC via a serial port -and run GridLocW ! Best of all, it''s free !
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
While doing a bit of research on Latitude/Longtitude to Maidenhead converters, I discovered that the likes of the ARRL only have links to DOS-based converters on their web site and that led me to extract some code from a Delphi-based application that I have been using for some time. The result is a program that will will run on any 32 bit version of Windows - ie Win 2000 and up, does decimal or degrees/minutes/seconds cross-conversions as well as the Maidenhead grid squares. To make it easier to use in some situations, I have written in some simple GPS support to determine latitude and longtitude details. Most GPS devices that output data to a serial port ( direct or via a serial/USB adapter) should work with this software. You will still need to press the "Convert" button to obtain your grid square details.. Hey, YOU have to do something.
The "Raw" tickbox allows part of the GPS data to be displayed so that you will find it easier to determine that you are on the correct COM port. Once you know, you will probably never use Raw again.
Please do not copy the file/s from this site and publish them on any other sites otherwise software revisions will not be apparent - and that means bugs will not be fixed in those versions. Always link to the actual files here so that any downloads come only from this site. |
|
---------------------------------------------------------------------------------------
Basic program mode - manual entry of latitude and longtitude details into either the Decimal format boxes OR into the Degrees/ Minutes / Seconds boxes.
Pressing the Convert button fills in the empty boxes and calculated the Maidenhead grid square.
--------------------------------------------------------------------------------------- |
|
With GPS support enabled by using the tick box at the RHS top. ---------------------------------------------------------------------------------------
Please Note:
The functionality of GridLocW has been extended to include a UTC date display plus a "Clock Set" button to allow you To test it once you have GPS data available, double click on the Windows (2000, XP,+..) system clock (typically bottom RH corner of your screen), Watch the Windows clock snap back to the correct time/date.. This Clock Set function has been included to make it easier to determine/set the correct time on the computer when out Field Day'ing. ---------------------------------------------------------------------------------------
Just a hint : Read these words behind the "About GPS" button FIRST !
--------------------------------------------------------------------------------------- |
|
GridLocW.EXE : NO LONGER AVAILABLE FOR DOWNLOAD - SEE GridLocWM.exe below OR GridLocW.ZIP : NO LONGER AVAILABLE FOR DOWNLOAD - SEE GridLocWM.zip below THIS version is dated 20/3/2009 and is known to have some "bugs".... There is greater error trapping included in the later releases ! Note - the above images may not show the current release date and all functions --------------------------------------------------------------------------------------- |
|
For those of you who want "more", there is an additional version of GridLocW called GridLocWM which has a world map facility built-in - which works in two ways.
The displayed info from the cursor position is reasonably accurate however as the map is not perfect, there are some small errors noted - particularly towards the RH side. The textual info is correct. Because the map graphic is included within the application, this version is considerably larger to download. This is what the main program screen looks like....
(Mouse over to see full size) CHANGELOG :
Note : in Australia, we use DD/MM/YY format so all dates quoted in documentation are this format. As of the version dated 02/04/2009, there is also an Australian map option which is accessed by selecting the AUS box next to the map button. Minor changes at Version dated 15/5/09 : Added automatical recall of main program position, updated date formats to suit international users, last COM port, last map used etc.. plus a map of the USA & some of the Central Americas. Maps ( World, Aus, USA) are selected from a drop-down box at LHS. Size is now 4.7MB as an EXE, 1MB as a ZIP. Minor changes at Version dated 16/5/09 : Added mouse pointer distance plus bearing from GPS location - featured only on World map - using Vincenty's formula. Added an extra checkbox on primary screen to allow display of Imperial measurements of GPS height and any distances (Metric is standard). Size is still around 4.7MB as an EXE, 1MB as a ZIP. Minor changes at Version dated 19/5/09 : Added an entry box for a destination Maidenhead Grid plus a Calculate button to convert back to a Latitude and Longtitude (at the centre of the grid), plus a distance in Km (/ Statute Miles) and bearing in degrees FROM the main Calculated Grid value. Minor changes at Version dated 20/5/09 : Added mouse pointer distance plus bearing from GPS location to the USA and Australian maps. When right-clicking on a map, a Summary box appears with the Lat/ Long/ Grid / Distance / Bearing values 'frozen'. The Summary box can be moved from over the map (to a clear part of screen) and subsequent left-clicks on alternate map areas will update the 'frozen' data. Added more error trapping for occasional floating point, COM and initial Windows registry startup errors.
World: AUS Map : USA Map : Other maps may be added in future releases IF I can find suitable linear map images. GridLocWM.EXE OR GridLocWM.ZIP Current version is dated 19/5/2009 --------------------------------------------------------------------------------------- |
|
No installation is necessary for either version, no setup.exe, no additional files. Just run GridLocW.exe / GridLocWM.exe from the folder it is saved/extracted into.. Free to download, free to use, but please - no copies on other websites. If, perchance, your GPS does not decode correctly then use something like Windows HyperTerminal to capture some of the raw GPS serial output into a text file to email to me. |
|
Formatting/indentation of the Delphi code has been lost in the functions & procedure listed below, which is normal for web pages which only allow one space between characters & no tabs. Even so, those who need to should be able to copy and paste into a Delphi Unit for inclusion with their own code to create an application.
------------------------------------ Added 30 June 2009 ------------------------------------
For those who are seeking info/code on Vincenty's formula in Delphi : //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ //* var begin lambda := L; dec(iterlimit); if (iterLimit = 0) then result := 0 uSq := cosSqAlpha * (a*a - b*b) / (b*b); a1 := arctan2(cosU2*sinlambda, cosU1*sinU2 - sinU1*cosU2*coslambda); // same lines as above but with different variable names to be declared globally // fwdAz = arctan2(cosU2*sinLambda, cosU1*sinU2-sinU1*cosU2*cosLambda);
========================================================================
For those who are seeking info/code on conversion of a Maidenhead Grid locator back to Latitude and Longtitude in Delphi :
// Again, not the neatest code I have encountered but certainly works.
Variables : mh = maidenhead in 4 or 6 charcater format, Lat : lat:6:2, Long : long:6:2
PROCEDURE maidenhead_to_latlong(mh : string; var lat,long : real);
var g1,g2,g3,g4,g5,g6 : integer;
begin
a := length(mh);
{ upper case}
{ separate chars of maidenhead code }
{ allow for last 2 chars to be missing}
g1 := ord(g1s) - 65;
ge := 20 * g1;
ge := int(ge - 180);
long:= (ge)+ (gn / 60);
te := int(te - 90);
lat := (te) + (tn / 60);
end;
|