A glance at a map of the UAE shows a hotchpotch of emirate frontiers that may bemuse an outsider. But few know more about their ins and outs than Julian Walker, the British boundaries expert who mapped many of them.
The task of delineating the borders took on a new urgency in the run-up to the British withdrawal from the Trucial States at the end of 1971, and Mr Walker was an obvious choice to get the job done as the clock ticked down towards independence.
The Foreign & Commonwealth Office (FCO) "wanted old hands in the Gulf because it was an awkward time and we would at least know the people and understand some of their problems", Mr Walker, now 82, recalls.
The diplomat had first come to the Trucial States in 1953, largely by accident. He hadn't wanted to study Arabic but "didn't feel in a very strong position to refuse" following his FCO exams. After learning the language in Lebanon he thought he was to be posted to Bahrain, but the day before he left it was decided he would instead be sent to Sharjah.
"It was a tiny little town with a few palm trees and in fact we had a political agency for the Trucial States there, in a broken-down coral building with no electricity, no proper transport," he said.
The British had decided that delineating the borders was a priority - without boundaries the oil companies could not operate as no one would know whose territory they were on. Mr Walker's superior, the Political Agent, began with the frontier between Umm Al Qaiwain and Ras Al Khaimah.
"After about eight hours in the desert he gave up, went back to the agency, decided he was too busy to do frontier work and decided that I should start to do frontier settlement work," Mr Walker recounts.
"There were no maps, that was a problem for a start. First I had to explore and draw maps. It was hot, very difficult in the desert. I would get Bedouin guides from one side, and Bedouin guides from another side. I'd have to do the mapping, decide where the frontier should lie and then go and discuss it with the rulers, and if necessary go back again and again."
Just 13 Britons - other than those with the Trucial Oman Scouts and Royal Air Force - lived in what was to become the UAE at the time. Mr Walker recalls his first visit to Abu Dhabi - then a town of no more than 3,000 people ruled by Sheikh Shakhbut bin Sultan Al Nahyan.
"Then it was about a seven-hour drive from Dubai and you had sabkha [a salt flat] before you got to the islands so you might get bogged down. I delivered about 100 rifles to Sheikh Shakhbut.
"He couldn't afford to put us up so we slept under the lorry between Al Hosn and the town and then I went in to call on him in the morning."
After his initial 18-month posting, Mr Walker was called back each winter for the next three years to deal with the Omani-Emirates frontiers and later the Dubai-Sharjah frontier.
When he was called back in January 1971, as Political Agent in Dubai in the lead-up to the union of the UAE, there were still internal and external border disputes with which to be dealt.
"I realised we were in for trouble. The states talking about union but not getting there. And we had disputes of course with Iran because of the three islands, and the Shah wanted compensation because he'd given up his claim to Bahrain and wasn't really prepared to compromise, at least not to start with.
"There were still frontier problems. Ajman and Sharjah were still asking me to make sure where the border was."
Though the three islands - Greater and Lesser Tunb, and Abu Musa - remain a problem even now, 40 years later, the other internal border disputes were resolved by the summer of 1971. The Ministry of Interior continued to consult Mr Walker over border issues up until 2004.
"In a way I was involved with all the UAE borders. The only one that I wasn't fully involved in was Dubai-Abu Dhabi, there was no time so I tried to get somebody else to deal with that because I was dealing with Abu Dhabi-Oman, Sharjah-Oman, Ajman-Oman, Dubai-Oman, Dubai-Sharjah et cetera."
"The frontier between Dubai and Ajman in Wadi Hatta is virtually the only frontier over which there was no dispute - simply because they'd fought each other earlier and they'd built a wall."