Section 1 of the Official Secrets Act 1911
(1) If any person for any purpose prejudicial to the safety or interests of the State—
(a)approaches, [F1 inspects, passes over] or is in the neighbourhood of, or enters any prohibited place within the meaning of this Act; or
(b)makes any sketch, plan, model, or note which is calculated to be or might be or is intended to be directly or indirectly useful to an enemy; or
(c)obtains, [F1 collects, records, or publishes,] or communicates to any other person [F1 any secret official code word, or pass word, or] any sketch, plan, model, article, or note, or other document or information which is calculated to be or might be or is intended to be directly or indirectly useful to an enemy;
Section 3 of Shedule 1 of the Official Secrets Act of 1920 which is a continuation and doesn't repeal the previous act defines a prohibited place as
Any work of defence, arsenal, naval or airforce establishment or station, factory, dockyard, mine, minefield, camp, ship, or aircraft belonging to or occupied by or on behalf of Her Majesty, or any telegraph, telephone, wireless or signal station, or office so belonging or occupied, and any place belonging to or occupied by or on behalf of Her Majesty and used for the purpose of building, repairing, making, or storing any munitions of war, or any sketches, plans, models, or documents relating thereto, or for the purpose of getting any metals, oil, or minerals of use in time of war
All of this is summed up on the sign with the words "This is a prohibited Place under the Official Secrets Act 1911-1939" There may also be local by-laws in place expressly forbidding photography
Now these signs line the perimiters of military installations. Just because a law against gathering information or being in the vicinity of said installation is rarely enforced doesn't mean it doesn't exist.
Big brother is watching you.