We present a novel split and merge based method for dividing a given metric map into distinct regions, thus effectively creating a topological map on top of a metric one. The initial metric map is obtained from range data that are converted to a geometric map consisting of linear approximations of the indoor environment. The splitting is done using an objective function that computes the quality of a region, based on criteria such as the average region width (to distinguish big rooms from corridors) and overall direction (which accounts for sharp bends). A regularization term is used in order to avoid the formation of very small regions, which may originate from missing or unreliable sensor data. Experiments based on data acquired by a mobile robot equipped with sonar sensors are presented, which demonstrate the capabilities of the proposed method.