This is the John Rae, the Pilot Boat at Kirkwall Harbour, in the Orkney's. When large ships arrive and leave at ports, they normally require a pilot to help them navigate the inshore waters. Pilots usually only work in one area and have an in-depth knowledge of local tides and other possible problems. They need to know their stuff, as when they are on board, they are superior to the captain, and are totally responsible for the safety of the ship.
The John Rae is used to get the pilots on and off the larger vessels.