Blog

26 juillet 2019 · R · Rayshader · 3D

Five hours on a laptop, six minutes in the cloud

Rendering a city in 3D from open lidar elevation data took five hours on an old laptop. On a free cloud GPU the same render took six minutes, fifty times faster.

Article en anglais.

A shaded 3D render built from open lidar elevation data took five hours on an old laptop. Moved to a free Google Colab notebook with an Nvidia Tesla K80 graphics card, the same render took six minutes: fifty times faster, at no cost.

The renders below come from two public elevation datasets. For Berlin, the 2018 ATKIS digital surface model published on the city's geoportal, FIS-Broker, which records the height of whatever the laser hit first: roofs, treetops, towers. For the Breton coast at Camaret-sur-Mer, the 1-metre terrain model of Litto3D, the coastal elevation survey of France's IGN and SHOM, which models the bare ground. The idea came from a shaded-relief map of Lebanon by the cartographer Fabien Lezeau; the method follows Daniel Huffman's tutorial on shaded relief in Blender, after first experiments with the R package rayshader.

A surface model shows the city, not the ground

Because the Berlin data record the first surface the laser meets, the render is a model of the built city. The Fernsehturm on Alexanderplatz rises as a needle above everything else, the Spree winds through blocks of courtyard buildings, and the Tiergarten shows up as a carpet of individual trees.

Figure 1

Central Berlin from its digital surface model: the TV tower stands above everything else

Shaded 3D render of the ATKIS digital surface model, 2018 · Berlin Mitte and Tiergarten

Isometric 3D model of central Berlin: dense blocks of buildings, the Spree river in blue, the green Tiergarten park at lower left and the thin spike of the Fernsehturm rising at the top
Data: Geoportal Berlin, ATKIS DOM · Render: Timeit data team

At Tegel the same data separate the city's land uses at a glance: the flat grey expanse of the airport, a forest and a lake on one side, the straight line of the canal, then allotment gardens and housing blocks.

Figure 2

At Tegel, the airport is a flat grey void between forest and housing

Shaded 3D render of the ATKIS digital surface model, 2018 · Berlin-Tegel

Isometric 3D model of the Tegel area of Berlin: the airport's flat runways in grey, a lake and dense forest at left, a straight blue canal across the middle, allotment gardens and housing at lower right
Data: Geoportal Berlin, ATKIS DOM · Render: Timeit data team

A terrain model shows the land beneath

The Litto3D terrain model strips away buildings and vegetation, leaving the shape of the ground. At Camaret-sur-Mer, on the Crozon peninsula, it brings out the ridge that runs to the Pointe du Gouin, the cliffs of the Toulinguet, the old field boundaries inland and the rocks of the Tas de Pois offshore.

Figure 3

Without buildings or trees, the coast at Camaret shows its ridges, cliffs and old field patterns

Shaded relief of the Litto3D 1-metre terrain model · Camaret-sur-Mer, Finistère

Shaded relief map of the Camaret-sur-Mer peninsula, the sea in flat blue-grey, with labels for Pointe du Gouin, Le Toulinguet, Tour Vauban, Plage de Veyriac and Tas de Pois
Data: IGN and SHOM, Litto3D · Render: Timeit data team

About the data

Elevation rasters were prepared as GeoTIFF files and rendered with Blender's Cycles engine, using a colour layer draped over the elevation. On Colab, a notebook installs Blender, enables the GPU and renders the scene from a .blend file and the two raster files stored on Google Drive. The five hours and six minutes are single timings of one render, one on each machine, not a benchmark. The renders are visual, not measurements: vertical scale is set for legibility and may exaggerate heights.

Code, including the Colab notebook and the Blender configuration script: github.com/clementlefevre/litto3d.