The lines of the Torres Vedras were lines of forts secretly built by the British from around September 1809-1812 to protect Lisbon during the Peninsular War.
The landscape was remodelled wholesale to make it more defensible. Every approach was covered by at least one fort, and all forts were mutually supporting. Trench-lines covered some of the more vulnerable stretches of land whilst Gunboats guarded the Tagus. The ‘third line’ covered the intended embarkation point in the event of retreat.