A Dutch district court has thrown out a bid by coffee shop owners to fight the introduction of a "cannabis card" aimed at stopping foreign tourists from buying the drug in the country.

New cannabis-for-residents-only laws are due to roll out on 1 May in three provinces and nationwide in 2013.

The owners of 19 coffee shops had lodged their case against what they described as "discriminatory measures."

But the court found that the cannabis card "does not violate the basic principles of the anti-discrimination law."

The plaintiffs said they would appeal the court decision, which their lawyer Maurice Veldman said was "a political ruling" that gives "authorities the green light to discriminate against foreigners."

The new restrictions will apply from next month in the southern Dutch provinces of North Brabant, Limburg and Zeeland on the Belgian and German borders and in the rest of the Netherlands next year.

Dutch coffee shops will now become closed clubs allowed up to 2,000 members from among residents, including foreigners, living in the Netherlands and aged over 18.

The move, which coffee shop owners say would harm an industry that has been a drawcard for travellers for years, was taken to protect locals against the nuisance of drug tourism and associated crime, authorities said.

Dutch residents have long complained about the impact of drug tourism including pollution, traffic jams, noise at night and a proliferation of hard-drug dealers on the streets.