📜 ⬆️ ⬇️

Base of all settlements and regions of Russia

For one project I needed to create a base of geographical names of Russia. Of all the sources of such information, the most authoritative seemed to me 2:

The latter seemed to me simpler, more complete and less redundant, although the names of the settlements there are four times more. I chose OKATO, because I found at least some description of the database on Wikipedia, and in the postal codes there was completely incomprehensible information. In this database, unnecessary administrative units were to be weeded out of the geographical units I needed.

Screenings occurred in several stages. At first I selected the regions, territories and republics, i.e. top level hierarchy. Then he took up cities and towns. The entire screening was carried out empirically. Identifying patterns, I sifted out all unnecessary husk, such as municipalities and districts of large cities. Describe the patterns do not see the point. For each level of classification, its own rules for eliminating administrative units, which can be viewed in the source code, are in the file below. I note that in the final files in the regions I created an identifier in the first field, and in the settlements, a link to it in the last field, in order to import into the database the identity of the settlements in the region. The format translated into csv, otherwise the data format remains the same. It should be assumed that there are most likely errors in the database. If someone finds it, write to the comments, I will rule, because the total number of settlements turned out to be about 140 thousand, and tracking them all is extremely problematic.
So, the code file on python, with the help of which screening and analysis was carried out, and 2 final files after the analysis of c regions and us. points can be downloaded here . I hope my work will prove to be useful to someone else.

')

Source: https://habr.com/ru/post/109425/


All Articles