How to use geodata to make maps — explained in five GIFs.

Niklas Heusch
IDinsight Blog
Published in
5 min readFeb 4, 2020

Do you want to put GPS coordinates on a map? Or do you want to visualize other information on a map? This post explains how in five GIFs.

Data and evidence drive our thinking at IDinsight. Geodata, or location information often used for navigation, is one such kind of data. Pertinent geodata is often available and informs our work with governments and NGOs. It can be a powerful way to understand and inform programs, telling us where people live and where the services such as schools, clinics, or infrastructure are close by. Mapping data can also be useful to understand how outcomes such as income or school enrollment rates differ across geographic areas, regions, or districts. These analyses are easy to start; in fact, you can do the most simple ones in minutes. This post aims to show you how through five GIFs (note that they might take moment to load, and are also linked as videos in the captions), using Google Maps (free), QGIS (free), or Stata (proprietary).

Situation 1: you have GPS coordinates that you want to see on a map

Recently, we were working with farmers in Northern Nigeria on agricultural extension services. Visualizing their locations on a map helped us to better understand where farmers lived and how spread out and geographically diverse their houses were. Shown below is our starting point: a list of farmers’ locations as GPS coordinates.

Figure 1: Farmers’ locations as GPS coordinates.

a) If you want results in one minute: use Google MyMaps

GIF 1: How to view coordinate data on Google MyMaps (watch as a video).

You also can:

  • Import addresses instead of GPS coordinates (Google MyMaps will place them automatically).
  • Customize the map (for example, display some points blue and others yellow): after importing your data, click on uniform style (on the left, for the layer you imported) and choose individual styles or style by data column.
  • Display polygons (simply import KML files): if you have data on the extent of fields, neighborhoods, catchments, etc.
  • Share the map with others.
  • Do even more (such as adding media or editing your data), explained in seven minutes here.

Try it yourself with this sample dataset on Google MyMaps.

b) If you want to go one step further (analyze your data, create custom visualizations, use different map layers): use QGIS

GIF 2: How to use coordinate data on QGIS (watch as a video).

You also can

  • Easily add satellite photographs or maps as the background to your locations (here).
  • Do almost anything you want- QGIS allows you to make beautiful maps, incorporate additional data sources, do analysis, etc. You can watch how to do this in a 30 minute beginner video (here) or use explore this website (here) for great tutorials.
  • If you have not used QGIS before: download QGIS here for free (Windows: use the standalone installer for the latest release).

Situation 2: you want to visualize data on a map and produce an image

a) If you are using Stata and want to generate maps from your do-file. For example, the countries where IDinsight has offices.

Figure 2: Output — a map of IDinsight offices, generated in Stata.
GIF 3: How to generate maps in Stata (watch as a video).
  • The Stata website has a good tutorial to get started with spmaps and customize outputs (here).
  • spmap allows the use of color schemes (use the option fucolor), and it’s easy to set the color scheme for your map. Color schemes available by default are Color Brewer (displayed here and here) and spmap-specific schemes (displayed here). To design your own scheme, the palettes command is helpful.

2b) If you are using QGIS (or don’t have Stata) and/or want to further customize your map.

Figure 3: Output — a map of IDinsight offices, generated in QGIS.
GIF 4: How to generate maps in QGIS (watch as a video).

2c) If you want to map data: for example, how many times has each country won the Champions League?

Figure 4: Output — Number of Champions League winners by country, generated in QGIS.
GIF 5: How to map data using QGIS (watch as a video)
  • Data on Champions League victories comes from Wikipedia; when joining this data to the shapefile, you need to ensure that countries have the same name in both datasets.
  • spmap similarly allows you to shade countries/features according to a variable (here, the number of victories). See the tutorial for details.

Where can you get shape files?

Be prepared to spend some time searching, this can be the bottleneck when making maps.

  • Through websites: GADM, Natural Earth, IPUMS, Google, ESRI (if you have access)
  • Through OpenStreetMaps: OpenStreetMaps has great coverage for many areas and can be used to give you shapefiles, for example of countries’ administrative boundaries. Here is how you can import OSM data into QGIS (and here and here as videos, for boundaries and points).
  • From your partners/the organization(s) you are working with.
  • By combining multiple shapefiles into one (see here) or editing shapesfiles (i.e. combine multiple features into one, see here and here).
  • From an image, by georeferencing it yourself (see here, here, and here).

Where can you learn more?

QGIS:

  • QGIStutorials is a great resource to help you get started, offering free, hands-on, step-by-step guides for QGIS (here).
  • Official, comprehensive, and well-written, the QGIS website also provides a training manual (here).
  • First time ever in QGIS: start with a great 30-minute video walk-through (here).

For spmaps in Stata, the official tutorial (here) and helpfile (here) tell you what you need to know.

We hope that this will ease the process of making maps no matter what platform you’re using. Questions? Issues? Suggestions for what has worked for you? Let us know in the comments below.

--

--