Blog

Ukraine from a GIS perspective - population density map

5 min

That’s one more case for me to write something after a long-long break. Surely, not the last one. I’ve refreshed and refined site look and feel a little bit, related to small details. Have tackled a task from a distant past being perpetually postponed. It’s a question of my photo portfolio, namely galleries section here that used to be nominal till now with just a dozen of photos as stubs. Finally, it’s filled with photos that define my shooting style well. But more about that next time. I’d be happy if you check out the galleries. Yeah, and one more FotoOsnova change — from now on the main language here is english.

But back to today’s conversation. Geography has always fascinated me. Being a visual person, I frequently stumble upon infographics and consider them carefully. Quite often they include maps. And that is the point for me to get acquainted with GIS visualization. The choice fell upon the population density map of my homeland, Ukraine. Amid the full-scale russian invasion, it’s particularly important to remember Ukraine as a whole. I had an urge to create something fancy-looking and clearly illustrated. 3D mapping is a good fit for this purpose.

How it’s done?

Technical

The first thing this task is characterized is a mix of a technical side and an artistic one. Surely, calling it artistic is somewhat of an exaggeration, but still requires some. And being close to photography works well within this site theme)

Let’s start with a technical overview. Data is the backbone of everything. .gpkg file format is widely used as a data container for GIS applications. It’s an SQLite database with a strictly defined structure. Can contain geo data as both vector feature representation and raster matrices within a particular coordinate system (SRS). There’s Humdata — an aggregator that includes publicly available datasets of different kinds by countries. We need 2 of them:
Ukraine administrative boundaries map
Ukraine population density map
Population data step is a 400-meter hexagon. So final accuracy is no more than that.

Kontur is the data provider here. The caveat is the data publication date, which is spring/summer of 2022. And it’s quite a bit further from a full-scale invasion start. There’s data related to the occupied territories from 2014 as well. It seems to be quite plausible, but please take data accuracy with a grain of salt.

There’s a flexible rayshader library that enables 3D mapping by elevation data (population height representation in our case). Let’s break down calculation and rendering process into steps:

  1. Find out country boundary coordinates, get future image aspect ratio and calculate output image resolution based on the aspect ratio.
  2. Rasterize data by given resolution to create an evenly spaced grid of population geo data. Create a 2D matrix of pure population values that represents height data. Remember, we’ve got a 400-meter step in a population density map. Each density point has its height that is defined at this step.
  3. Create a color palette. Set the first and the last colors that correspond to the lowest/highest population values. Set intermediary values and use linear interpolation to create a palette. It owns 256 values in my case.
  4. Apply color palette to the population height data. This way elevation values are mapped to their corresponding colors.
  5. Render a 3D elevation map with tuning parameters. And save as a graphic resulting file.

Finally, it’s time for the artistic process to come into play))

Artistic

As a result of the technical part, we’ve got a canvas with a 3D map. Its appearance is defined by the default parameters mainly. To obtain the desired look, we need to tune quite a bit. We’ve defined a color palette previously. Spike color gradient depends highly on that palette. Ukraine population density is characterized by several high spikes of the biggest city centers, quite a bit of middle-height spikes, and lots of small-height ones corresponding to small towns and district centers. Thus, we need to find a balance when the high-density area gradient is clearly visible while smaller ones remain close to uniform in color. The next thing is background color, that purpose is to shade the main data, not causing too much of a distraction.

Height scale is another crucial parameter to be considered attentively. Extremely high coefficients make even small population area spikes look bigger, overflowing with data in such a way that it becomes difficult to «read» the map. Whereas low coefficients cause the map to be flat and tend to lose high-density areas’ information. Balance is the keynote of the artistic process)

Camera positioning via starting point, angle, zoom selection is crucial for the resulting perception. For instance, low angle provides a better perception of height spikes, while high angle produces «flat» map but with a more visual overall country representation. Camera point shifted towards some edge allows to see that region more clearly.

And the last point — all of these parameters should be chosen in combination that play better for the particular dataset. So, «find balance — adjust», «find balance — adjust», «find balance — adjust», «find balance — adjust». And so on to infinity, till achieve the result that you’re pleased with.

Let’s see the results!

First of all, how to read the map? As you probably already know, the higher the spike — the more populous that area is.

It’s a direct classic view with a high angle. Here you can observe an overall population distribution clearly. Major cities are seen at once: Kyiv, Odesa, Lviv, Kharkiv, Donetsk, Dnipro, Zaporizhzhia. More populous small town and rural areas are more common for the western and central Ukraine parts. While bigger cities, laid out more densely, are peculiar for the eastern part. Donbas is the apotheosis of the population density spread by larger scale areas. Though not the highest one at particular spots. Crimea and the Carpathian mountains are clearly seen as free of people.

ukraine population density map
Lower angle view enables more convenient height distribution observation
ukraine population density map, high spikes

Kyiv and Odesa own the most populous spots. However, Odesa’s high-density area does not extend far. It’s entertaining to see thin spots like Nikopol or Pivdennoukrainsk cities in the map center. Those are small to medium-sized cities at max, but low area is sufficient to produce such a huge spot spike.

ukraine population density map
ukraine population density map


That’s it for now. Hope I’ve sparked your interest in geography, GIS visualization, graphics overall and Ukraine.