An earthquake of magnitude 7 struck off the coast of Riverton in New Zealand on Tuesday, the United States Geological Survey said.