Map Generation and Map Delivery

The architecture to create a map server can be split into two domains:

1. Data Integration

The toolchain which turns styling information into a format for the map drawing engine.

This is where you prepare your GIS data which will be displayed in the final map. All coloring and styling of map features is defined in this step.

2. Http Map Server

The web server which delivers the map to the client via http protocol.

This is where you enable any on-demand rendering and caching of your map.

`

Data Integration

In very simple terms, a Map Server delivers a map as an image. This image is rendered from a hierarchy of data layers. These layers are rendered on top of each other to create the final map image.

The different layers usually source from different geospatial information assets.
For example, the lowest layer could be a low-resolution satellite imagery. This is called the base layer as it covers the entire map and all other layers are rendered on top of it.

The layers rendered on top of the base layer, usually contain vector information of individual spatial features.
For example, this could be road topology or buildings.

Map layers flattened into map image

Raster and Vector Data - Difference

GIS Raster Data Icon

Raster Data

A lot of GIS data comes in the form of Raster Data.

The source of Raster Data usually is a physical camera or radar sensor. The prime example is satellite imagery. Other source of Raster Data could be imagery taken by a drone or elevation data from a radar sensor.

Raster Data comes in the format of an image whose pixels contain the sample values. For a true-color satellite image, this is the RGB values. For elevation data this terrain elevation at every pixel position.

Each Raster Data image contains a spatial reference:

  • A location reference of the image
  • Projection information of the image

Most commonly, Raster Data are GeoTiff files. These are TIFF image files which contain the spatial reference in their metadata header.
It is also possible to store the spatial reference in a file separate from the images. This is a common solution when the imagery is split into many image files and there is one file containing the spatial reference for all images.

GIS Vector Data Icon

Vector Data

Vector Data describes basic geometries such as points, lines and polygons. The shape of these geometries is expressed in geographic coordinates which enables them to be located on a map.

The source of Vector Data could be the result of a survey of individual spatial features. Usually, Vector Data carries data attributes in addition to its spatial information.

For example, consider the following list of cities:

Name Population Coordinate
Abu Dhabi 1.800,000 (54.366667, 54.366667)
Dubai 3,500,000 (55.297222, 25.263056)
New York 8.800,000 (-74.00611, 40.712778)

This list can be interpreted as Vector Data. We can place a point geometry for each city on a map.
The styling of geometry can depend on the non-spatial data attributes. For instance, we can shape the size of the point geometry based on the population number or show the city name beneath its location. The styling information is not part of the data, but defined by the map server.

Vector Data can come in any data format. Two of the most common ones are:

  • Shapefiles are binary files which contain a catalog of geographic features with custom data attributes.
  • Vector Databases such as PostGIS save all spatial data and attributes in a database.

Map Definition

Map Definition File

The different layers which make up the final map are defined in a map definition file.
This definition file contains

  • Selection information for each layer
  • Styling information of each layer

Therefore, the map definition file tells the server how to select the data layers of the map and the style of the selected layers in the final map picture.

Selection Information tells the map which features of a source layer to include and which features to exclude from the final map rendering.
For instance, you may have a list of cities to be drawn on the map, but you want to limit the selection to those cities with a population of more than 1,000,000.

Http Map Server

A Http server sits at the point of delivery of the map imagery. It is responsible to deliver map to the client displaying the map.

Since most clients are either a website or web-enabled (mobile app), the delivery of the map is based on standard http protocol transmission.

Using http has several advantages:

  • Existing Architecture

    Most distributed applications are web-applications or - at least - web-enabled. So there already is http delivery architecture which can be recruited for the map server.

  • Web Delivery

    Recruit the power and performance of existing http infrastructure. This may include load balancing, data caching and content delivery networks.

Map server using http(s) delivery

Delivery Strategies

The web server delivers a map when requested by the client. The actual map image can either be

  • On-demand rendering with every client request.
  • or Pre-rendered and stored. The stored map will then be delivered when requested by the client.

On-demand Rendering

The server can render the map for every request by the client.

This enables the client to parameterize the map generation:

  • Layer Selection

    The client can select the layers to be drawn in the map with every request. For instance, the client may request the road topology to be excluded in an urban map.

  • Map Extent

    The client can request the exact coverage area (extent) of the map being rendered. The client may also be able to select the granularity of detail drawn on the map.

  • Map Projection

    The client can request different projections. This is useful if the client's map display needs to support different projections.

Rendering a map is computationally expensive. Therefore, the disadvantage of on-demand rendering is the high latency of the server. On-demand rendering is also expensive to scale.

Its difficulty to scale has made on-demand rendering literally absent from mapping in web-applications. However, it does play a key role in professional GIS services and is often used in pre-rendering maps for the web.

The OGC Web Map Service (WMS) is an example of a pre-rendered map service.

Pre-Rendering

Pre-rendering creates the actual map imagery before the http server accepts requests. The map imagery is stored and delivered from storage when requested by the client.

Pre-rendering relies on map tiling. It seperates the complexity of map rendering from map delivery:

  • Simple Web Server

    Free of any rendering, the map delivery can be performed by any standard web server. The delivery can be based on existing technology for providing high-performance web delivery. Any http web server can be used to delivery the map.

  • Offline Rendering

    The actual map rendering can be performed offline. It can be partitioned to computing infrastructure dedicated to the rendering.

    Any sensitive information can be kept in the offline domain, without being exposed to a potential breach in the online environment.

The core disadvantage of pre-rendering is the need for storage space. A map with global coverage at street-level detail will easily exceed storage requirements of 100TB.

Pre-rendered maps are static and their rendering cannot be parameterized for client requests.

Google Maps and OpenStreetMap are examples of mapping services using pre-rendered tiles.

For large deployments, it is common to combine both strategies: Pre-render frequently used map resources and on-demand rendering for infrequent and specialized map resources.
Usually this is accompanied by strategies for temporary caching.