How can I set the location on my macbook from a GPS set when out of range of any WIFI signal (e.g. at sea)?
You'd have to read the GPS manual & see if it has any form of mac connectivity/drivers, otherwise you'd need to buy a GPS dongle - this is just the first one I found, no doubt there are many others - http://www.amazon.com/GlobalSat-ND-100S-USB-GPS-Dongle/dp/B003WNHGAO
The location on your Macbook uses WiFi signal. It does not work without it. In simple words, every Wifi broadcasts its identifier code (that is used to determine its location) so that is how your Mac knows where it is.
Wi-Fi is far more than a network connection. It's a location source. Combining the Wi-Fi (BSSID) with the Signal strength, GPS, Cell Towers and IP address is used to locate the position of the Wifi broadcast. But due to the nature of WiFi signal it is only accurate to about 30 meters range. In addition, new technology uses the Bluetooth to pinpoint the location down to few meters.
If you plan to be out of range of WiFi (ocean) then you need a GPS hardware (USB stick) and software that goes with it.
Just for demo purpose use this website to show your location that is based on your IP address.