13 Geospatial information visualizations

 

This chapter covers

  • Manipulating GeoJSON and TopoJSON data
  • Comparing projections and their effect on map layouts
  • Drawing points on a map
  • Enabling a zoom and pan functionality
  • Listening to the brushing event

The last type of visualization that we’ll discuss in this section is maps. Maps are a symbolic interpretation of geospatial data. They use different projections to draw the surface of the globe we live on onto a flat 2D plane.

Because mapmaking and geographic information systems (GIS) and geographic information science (GIScience) have been in practice for so long, well-developed methods exist for representing this kind of data. D3 has robust built-in functions to load and display geospatial data, and most of them are included in the d3-geo module.

In this chapter, we’ll use two types of geographic data: GeoJSON and TopoJSON. We’ll study different projections from which we’ll create maps. We’ll also add standard functionalities, such as allowing users to zoom and pan the map, and less common ones, such as listening to a brushing event to filter the data visualized by the map.

13.1 Geographical data

13.1.1 GeoJSON

13.1.2 TopoJSON

13.2 Drawing a map from GeoJSON data

13.2.1 Choosing a projection

13.2.2 Improving readability with graticules

13.2.3 Making a choropleth map

13.2.4 Locating cities on a map

13.3 Zooming and panning

13.4 Adding a brushing functionality

13.5 Drawing a map from TopoJSON data

13.6 Further concepts

13.6.1 Tile mapping

13.6.2 Canvas drawing

13.6.3 Raster reprojection

13.6.4 Hexbins

13.6.5 Voronoi diagrams

13.6.6 Cartograms

Summary