top of page

Mimicking Night Lights With QGIS And Open Street Map

Cities from Space, I can't get enough of it.

Lyon at night from space

Since I don't have an International Space Station and a handful of astronauts floating around, I wondered if I could recreate the night-time image effect using more down to earth methods?

The most detailed, global, free data is Open Street Map.

I chose Europe, as it has a developed and functioning railroad network, and since historically cities and urban centers grew around the railways, the network still represents major urban centers,

Here's Europe's rail network.

Needs some work.

Because of the very large scale (1:30M), I have to use very a fine line width, otherwise the width would bee too thick. Yet a thin line means I may loose the density effect for regions with a greater number of railways - a proxy for higher urban footprint. Using QGIS Feature Blending we can achieve a line density effect. Adding the right color to the mix, a shade of reddish-orange [255,90,0] in this case, creates a yellowish line network. As a bonus, rail platforms, usually near urban centers, create a higher density and a "brighter" result.

Much better, but something seems off.

Looking at the actual ISS image, we can see that not all light are sodium lights, and there is a hint of blue and white amidst the yellow. As city centers usually have a tram or underground system, I duplicated the rail network, but this time only showed the two aforementioned classes. Using the same blending effect and giving them a cyan color [35,255,225] recreates the effect.

Success!, but can it be improved?

Another thing noticeable from the space photo is some sort of speckle. We can discern very bright spots in the cities and villages, as well as light points in dark regions. To achieve this effect, we need a feature layer that can render as hot spots, and that also slightly corresponds to the man made footprint of countries, as opposed to natural features.

This time I used the Transportation POI layer, but excluded Bus stops and Railway stations. The reason being that there are too many bus stops, especially in central Europe, and that the railway features overlap the rail network and thus emphasize the same thing.

The other features add variability, and light sources appear all over, in dark regions and along the coast, thus creating an outline of the continent.

Perfect*.

*You see, I am limited to the quality of images I can upload here, and a this 150dpi render just doesn't do the actual result justice. Here is a screenshot of the map in QGIS.

While this map in no way attempts to show actual night lights, it does a good job of representing the spatial distribution and the color of the images taken from space.

Featured Posts
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page