Woolwich was the headquarters of the Royal Artillery and the Royal Horse Artillery. The Sappers is another common term used for the Royal Engineers.
He did not dig trenches in any war with Germany as none existed at that time - sorry Mike.
As a sapper attached to Royal Artillery his duties are most likely to have been construction of gun emplacements.
Gibraltar was Britain's great fortress controlling the Mediterranean and acting as a supply point, during his service, for Naval operations against the Barbary slavers - no major power wars right then.
Canada may have been during the War of 1814 when the USA made some attempts to conquer Canada but only got the original White House in Washington burned down.
