Map of the Kostroma province industries
![The map can be viewed (and, if desired, downloaded in kml format) on Google Maps. The map can be viewed (and, if desired, downloaded in kml format) on Google Maps.](https://habrastorage.org/getpro/habr/upload_files/fdd/7ad/b5d/fdd7adb5d7b3d59f5663901c59bf34ee.png)
Our team collects, processes and publishes historical data in electronic form that is useful for genealogical research. A special place among them is occupied by lists of populated places (note: “populated place” is the same as “populated area”, but until the 1920s the former term was predominantly used). These lists were in most cases published in the provinces, which is why their format and content vary significantly.
For example, there is a wonderful list of populated areas in the Vitebsk province from 1906, in which for each populated area it is indicated which church parish it belonged to – and this is key information for genealogical research, since all records of births, marriages and deaths were kept in churches.
In many cases, lists of populated areas were compiled based on the results of zemstvo socio-economic studies (note: zemstvo – pre-revolutionary local government body). One of these publications includes a list of populated areas of the Kostroma province in 1907, which contains information about local industries. The original reference book, or rather its scan, with which the entire work begins, looks like this.
![](https://habrastorage.org/getpro/habr/upload_files/e5f/b3b/903/e5fb3b90332b9583f64fccc19f970639.png)
We recognize this text from the reference book in the table format, convert it to the unified format of our database, and then link it to the existing database of populated areas, which is based on the modern OKTMO and AGKGN registers (they cover approximately two-thirds of the total number of populated areas that historically existed on the territory of Russia over the past two or three centuries). Linking records with populated areas is a rather labor-intensive procedure, since many populated areas mentioned in pre-revolutionary documents no longer exist, but using data on distances (note: one of the most frequently encountered characteristics in such publications is the distance from the village to the city, volost government, etc.) most of these gaps can be reconstructed and the missing marks can be added to the map. We have specially trained people who know how to work with old maps, for example, with the resource etomesto.ruVillages with unique names also help a lot, for example, Vykhino In the Russian Empire there was only one.
![As a result of this painstaking work, we get a set of tables with villages, their characteristics and connections with higher levels (parishes and counties), as well as with settlements from the database. As a result of this painstaking work, we get a set of tables with villages, their characteristics and connections with higher levels (parishes and counties), as well as with settlements from the database.](https://habrastorage.org/getpro/habr/upload_files/842/674/aec/842674aec51a2ed4fc219e300157ec20.png)
Now we have data that can be worked with in table, text and GIS editors. To begin with, let's simply cross-check and see how well the villages were linked to the settlement database. To do this, open QGIS, add an osm base, and load a single table with coordinates and higher levels via CTRL+SHIFT+T. Then right-click on the layer and open Properties of this layer, where we specify Symbology as Categorized, where we sequentially select different attributes (county, parish, distance, etc.).
![This is what the map looks like if the village markers are automatically colored in county colors. If some marker This is what the map looks like if the village markers are automatically colored in county colors. If some marker](https://habrastorage.org/getpro/habr/upload_files/5f1/da9/219/5f1da92198972cae0392e73c142d3382.jpg)
Now we need to standardize the industries. Kostroma province, along with neighboring Yaroslavl, was one of the most developed provinces in terms of industries, a huge number of local peasants went to earn money in the capital and other cities. The summary table shows that there are under 2000 unique values in the column with industries, and in many cases the abbreviations are not the same and often several industries are listed in a cell in this way. Of course, we only need the most popular one, but it is a pity to lose information, so we need to expand all the industries line by line. This is done as follows: replace the comma with a space with the separator “|”, pull in a unique record identifier through the same separator (we use uuid-4), and then in a text editor using regular expressions we replace all the separators with a line break. Then in Excel in each row we duplicate the identifiers with a formula until the next identifier.
![It is clear that in the third line the separator was simply a space, but it is impossible to change all the spaces to separators, since the names of many industries contain a space. It is clear that in the third line the separator was simply a space, but it is impossible to change all the spaces to separators, since the names of many industries contain a space.](https://habrastorage.org/getpro/habr/upload_files/d7c/938/732/d7c938732e7c2c86748c95594f5ed8bb.png)
Now we need to unify these values, and when they are all expanded line by line, it is much easier to do this. We sort the resulting unique values alphabetically and reduce them to a single value (“pl.”, “plot.”, “plotn.” → “carpenters”). Before sorting, do not forget to save the original order in a separate table, since we are interested in the most common trade, i.e. the first in the list for each village. As a result of all these operations, we get a set of 11,607 settlements with coordinates, which account for 111 dominant trades there: from sewage cleaners to plasterers.
![Villages of Kostroma province, painted in the colors of the most widespread trade in those places Villages of Kostroma province, painted in the colors of the most widespread trade in those places](https://habrastorage.org/getpro/habr/upload_files/3d9/0cc/fd2/3d90ccfd2e0c3b0e87dec811d4873140.png)
The map is already becoming quite interesting: large clusters of factory workers in the southwest (modern Ivanovo Oblast), painters in the vicinity of Galich, and tailors near Neya are visible. But for ease of perception, it would be good to somehow color and unite the intermediate areas. Voronoi diagramit can be found in QGIS in the section Vector → Geometry Tools → Voronoi Polygons. We assign village attributes to the resulting diagram via Vector → Data Management Tools → Join Attributes by Location.
![](https://habrastorage.org/getpro/habr/upload_files/5db/8cc/66a/5db8cc66af31342f9ec4c42747b3b974.png)
We trim the resulting image using Vector → Geoprocessing Tools → Intersection along the approximate border of the Kostroma province.
![](https://habrastorage.org/getpro/habr/upload_files/8bf/3b9/ca9/8bf3b9ca971dcf4d9340163892ff931a.png)
And then we combine individual polygons via Vector → Geoprocessing Tools → Dissolve, specifying the field with the fishery as the criterion. When using the Voronoi diagram, we often get rather “ragged” boundaries with sharp angles, so we generate a hexagonal grid via Vector → Research Tools → Create Grid with a step of one kilometer, and then assign attributes from the Voronoi diagram to it via Vector → Data Management Tools → Join Attributes by Location.
![](https://habrastorage.org/getpro/habr/upload_files/49d/225/9ae/49d2259ae0f807d3b3eaf9d1f5a7a591.png)
The resulting map can already be shown, but there is very little time left before the festival, and I want to somehow quickly make an accessible online map so that listeners can look at it right during the presentation and zoom in on the places they are interested in. There are not many options here, two main ones: Google maps and Yandex maps. Yandex, unfortunately, is out of the question right away, since such large objects cannot be imported.
![](https://habrastorage.org/getpro/habr/upload_files/c44/7e6/383/c447e63831027f06f71f040553cdce78.png)
There are still Google maps, where it will also turn out that you cannot import a kml file larger than 5 MB.
![](https://habrastorage.org/getpro/habr/upload_files/66b/dda/b44/66bddab444aedf0fae83f8c040653ba0.png)
And we just got a map a little more than 5 MB, what a shame! We start looking at the contents of the kml file in search of something that can be cut and find excessively long coordinates of 12–13 characters after the decimal point (in our case, 5 characters after the decimal point will be more than enough). We return to QGIS and export kml again with a limitation on characters after the decimal point. It turns out to be 3 MB, the file is successfully imported, and after a little coloring, the map is finally ready!
![The map can be viewed (and, if desired, downloaded in kml format) at the link. The map can be viewed (and, if desired, downloaded in kml format) at the link.](https://habrastorage.org/getpro/habr/upload_files/d0f/472/6d3/d0f4726d3cb1ed26134346ca9d964473.png)
Now you can admire the work done. Some selected places on the map:
![A large A large](https://habrastorage.org/getpro/habr/upload_files/cba/22d/31b/cba22d31b50e957ea5f828f0b5fe57e7.png)
![Professional beggars in a village in Ivanovo region. And this has happened. Professional beggars in a village in Ivanovo region. And this has happened.](https://habrastorage.org/getpro/habr/upload_files/ee9/71d/8dd/ee971d8dd334593b633023b2d3501f9e.png)
![Serpozubs (I had to google who they are) in the vicinity of Susanino - they travel and offer to sharpen agricultural equipment Serpozubs (I had to google who they are) in the vicinity of Susanino - they travel and offer to sharpen agricultural equipment](https://habrastorage.org/getpro/habr/upload_files/df9/0f1/b3b/df90f1b3b7a655ea34e4b4c8b98c4c21.png)
![Sewage disposal workers in the vicinity of Kostroma (I wonder if local history has preserved stories about the glorious industrial past). Sewage disposal workers in the vicinity of Kostroma (I wonder if local history has preserved stories about the glorious industrial past).](https://habrastorage.org/getpro/habr/upload_files/a3f/41f/a3e/a3f41fa3ec89d48a656306bf82bf5036.png)
![Cat trade in the village of Kholm (they prepare cat fur for city fashionistas). Cat trade in the village of Kholm (they prepare cat fur for city fashionistas).](https://habrastorage.org/getpro/habr/upload_files/22d/564/99e/22d56499efd4471d6bcdb02bf0d12b9b.png)
![Professional pretzel makers from the village of Rylovo. Professional pretzel makers from the village of Rylovo.](https://habrastorage.org/getpro/habr/upload_files/9d4/3cd/6d2/9d43cd6d27edbf8c31dbffab499c9a63.png)
I think that the reader who has reached this point will find interesting places on the map himself.
Thank you for reading!