However, 2.5D is sufficient to describe most natural terrains, while keeping things simple. Terrain can be stored in a number of file formats but is mostly delivered as GeoTIFF, a format which in addition to the data contains the size of the raster and the position in geo coordinates, plus projection information. As the files tend to be very large they are usually split into more manageable tiles.

If you want to build your own maps you can now get data from a number of popular free sources or even make your own. For small areas you can now gather this yourself by flying drones. For anything larger you are stuck with either buying or sourcing free data. Fortunately the free offering is getting very comprehensive.

Here is a list of some good free terrain data sources to get you started:

Tiling and quad tree zoom levels

Tiling is the current standard way to efficiently load and display web based maps. This method can be applied to both raster and vector content. For example, satellite images are stored and transferred as bitmaps. Roads and geographic geometry are typically stored as vector data. This data is then partitioned into tiles and for each zoom level there is a separate tile set with the appropriate level of detail. This method is called quad-tree tiling.

Tiling of images (same principle applies for terrain and vector data): All tiles have the same resolution, so for lower levels of detail, less tiles are used.

Why meshes?

We can apply the same tiling principles to terrain data, since it is similar to image data. However, once transferred to the client, the terrain data needs to be displayed in 3D, and for this we need meshes. There are a number of ways to create these:

Meshing on fly

In the simplest case we use an existing image tile server to transfer raster terrain and convert to a dense mesh on the client, just before rendering. This means every height measure in the raster becomes a vertex in the mesh. This however places extra runtime demands on the client as meshes with many vertices are slow to render.