Heat oven to 350° F.
Halve the potatoes lengthwise and cut each half into 1/4-inch-thick slices.
Heat the oil in an ovenproof, preferably nonstick, skillet over medium heat. Add the potatoes and cook until almost tender, about 10 minutes. Add the onion and cook until softened, about 5 minutes. Carefully pour off all but 1 tablespoon of the oil from the potatoes and onion. Season with 1 teaspoon of the salt and the pepper.
Meanwhile, in a medium bowl, combine the eggs, the rosemary (if using), and the remaining salt. Pour the eggs over the potatoes and reduce heat to low. Cook, without stirring, for 1 minute. Stir once and cook until the eggs begin to set, about 3 minutes. Transfer to oven and bake until set, about 8 minutes. Use a knife to loosen the omelet from the side of the skillet. Slide or invert it onto a plate. Slice into wedges. Serve hot or at room temperature.
Tip: A Spanish omelet is traditionally cooked entirely on the stovetop. To try this, when the eggs begin to set, slide the omelet onto a plate, invert it back into the skillet, and finish cooking over medium heat. Or, if you're feeling adventurous, flip it.