With its 19th-century prosperity, Valparaíso expanded upwards from a narrow coastal plain.