The Anti-Atlas extends from the Atlantic Ocean in the southwest of Morocco toward the northeast to the heights of Ouarzazate and further east to the city of Tafilalt (altogether a distance of approximately 500 kilometers ).