Web Mapping & Analysis

Data Architecture & Formats

Dani Arribas-Bel

Today

  • Spatial Data
  • Spatial Data Formats
  • Selecting the right format

Spatial Data

How we represent the world in a computer

  • Vector
  • Raster

Vector

Represent each entity with a shape or geometry. Simple features:

  • (Multi-)Points
  • (Multi-)Lines
  • (Multi-)Polygons

Divide space into a finite set of entities

[Source]

[Source]

Raster

Use an image and control pixel colors to encode value

The value assigned for each cell represents the attribute of that cell

  • Continuous variables, surfaces (temperature, density, elevation…)
  • Satellite images (land cover, land use…)

[Source]

[Source]

Spatial Data Formats

Spatial Data Formats

In principle…

  • Points, lines, polygons –> Vector formats
  • Images, surfaces –> Raster formats

But these boundaries are blur…

Traditionally

Vector

  • Single files: shapefiles, etc.
  • Client-server (geo-)DBs: PostGIS, etc.

Raster

  • Mostly (single) image formats: GeoTIFF, etc.

However…

Many of these formats were designed for an offline world, so display some of the following:

  • Binary (“non-streamable”)
  • “Unqueriable”
  • Complex format structures

Modern formats

New formats have appeared in part “fixing” those issues, but also responding to web needs:

  • Streamable (e.g. GeoJSON)
  • Queriable (e.g. PostGIS/Geopackage)
  • Single file (e.g. .mbtiles)

Let’s explore a bit more on a couple of them…

GeoJSON

Advantages

  • Plain text, (human) readable
  • Streamable
  • Well integrated with web standards (JSON)

Excellent exchange format

Disadvantages

  • Plain text, inefficient
  • Non-queriable
  • Vector only

Tilesets (.mb/vtiles)

Map Tiles

Advantages

  • Queriable (SQLite)
  • Fast access to large maps with limited resources (client/server model + queriable format)
  • Some (vector tiles) are stylable

Disadvantages

  • Designed for serving not analysing
  • A dataset needs to be stored at several zoom levels
  • Once created, hard to modify (e.g. reproject)

Selecting the right format

Selecting the right format

No silver bullet…

  • What type of data do you want to store? Vector, raster
  • What are you going to do with the file? Analysis, serving
  • What environment are you working? Locally, web

Quiz

  1. Large dataset of tweets you want to analyse PostGIS/Geopackage
  2. Drone imagery to make available for workshop participants MBTiles
  3. Street basemap to provide context to a small dataset you want to make available on the web Vector tiles
  4. The small dataset from 3. GeoJSON

Creative Commons License
Web Mapping & Analysis by Dani Arribas-Bel is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.