I would love to give "Lobo" the credit for using GPS to check compass heading, but it has been described for quite some time. Ritchie thus suggests how GPS can be used to check the compass headings:
"Method 2. (Requires the use of GPS or Loran)
Step one. While at sea, with the compass in its intended position, but not finally secured, obtain the Loran/GPS bearing to a visual buoy or landmark that is within 10o of a North/South line.
Step two. Position your boat along that line and steer your boat directly at that mark. Turn the port/starboard compensator until the compass heading matches the Loran/GPS bearing.
Step three. Check the Southerly course by steering away from the mark, to a bearing 180° from Step 2. The compass heading should be bearing from or bearing to +180 degrees. If any error is present, it is an alignment error. Rotate the compass itself to correct for one half of this error. Repeat Steps 1 & 2 and then recheck this Step 3.
Step four. Simply repeat the procedures of Steps 1, 2 and 3 for the East/West course, using the fore/aft compensator, although, at this time, any alignment error should have been eliminated, and no alignment correction is required.
Step five. Upon completing the procedure, secure the compass in its final position.
Note: When performing this method, always use the bearing "To or From" mode on the Loran/GPS. Do not use the Heading Information because it is inaccurate in real time."
This still gives a relitatively rough idea of the compass bearings at each 5 degree incriment. (The reason I recommend the Sun Compass technique is that it will compensate for each degree, if necessary)
I first used a GPS I took to a friend in Australia in 1990/91 when SA was off during Desert Storm, and used it to check compass headings and found some errors with this technique--and I am sure that I am not the first to do that. Loran was utalized prior to that time for similar compass checks.
I agree with much which Les says. However, there are specifics when a compass is useful. Specifically when the boat is at rest or anchor. We always take a heading out of our anchorage--since GPS will not accurately show a course until underway, and the course will vary depending on how averaging is set. On several occasions we have had to leave anchorages quickly because of a lee shore in limited visability as wind velocity made the anchorage unsafe--and that pre taken compass bearing was the best way to get a safe course out of the bearing. Thus, I do think it is worthwhile compensating and making a Napier Diagram for each fixed compass--and the fluxgate (electronic) units.
We have a remote fluxgate compass which is installed in the Tom Cat. But even with a fluxgate or electric compass you need to do a Napier diagram (which shows the deviation of the compass with each piece of electrical equiptment running--for example with the windshield wipers on and off, nav lights on and off, wipers and lights on etc. Also the small compass cards are hard to read closer than 5 degrees. I spent many hours when young steering with a true 4" compass (now in my living room) where it was possiable to steer a coarse to one degree.
We also have a "Hockey puck", as well as the binocular hand bearing compass as back ups (and to take ranges for navigation if necessary--and specifically when setting anchors to check for dragging.)
As a rough check for the compass bearing--yes the GPS can be useful, but other techniques are better for accurace compensation.