Consulates issue periodic travel advice and warnings to their nationals. They may now need to tell them not to travel to the mainland with global positioning devices. In today's world, the Global Positioning System has become indispensable; even the popular iPhone is equipped with it. But for decades, foreigners have been banned from surveying and mapping activities unless they have obtained a permit, which is issued by the central government and is difficult to obtain. Two years ago, the ban was extended to carrying GPS devices. On Monday, state security officials publicised the case of a US mining expert, Calvin Herron, who was arrested in Luoyang, Henan province, in December 2007. He was caught with surveying and GPS devices, fined 100,000 yuan and subsequently deported. All his equipment was confiscated. The case was obviously publicised as a warning to foreigners. The regulation dates to the Maoist era of the 1950s. It is not clear how many foreigners have been arrested under it. Though a technical regulation, it specifically targets foreigners and aims to deter spying and surveying of sensitive mainland facilities and installations, especially military sites. There is speculation Mr Herron may have been arrested near some missile sites. Locals are not subject to the restriction, though there is a myriad of laws to justify an arrest. In an age of spy satellites and smart bombs, GPS may be overrated as a spying device. All countries have legitimate concerns about national security, but it is absurd to design a law that targets only foreigners. Locals, too, can be employed to spy for another country. The regulation is easily subject to abuse, since a visitor using an iPhone can be arrested unless they obtain a permit. If officials are worried about security around military installations, they should fence them off and warn people to keep away or risk being arrested. As it is, the regulation smacks of xenophobia. A law that is ineffective, unnecessary and potentially racist is the worst kind of law. It is time to scrap it or make it less offensive to justice and common sense.