Downloading shapes / topological data

Downloading

Maps can be downloaded here: https://gadm.org/download_country_v3.html

Select a country and click on “Shapefile“ this will prompt you to save a zip file with all the files in it.

  • There are multiple files in this file.

  • 5 files per layer e.g. gadm36_DEU_2.xxx

  • the 5 layers are

    • 0 for country

    • 1 for states

    • 2 for counties

    • 3 for municipalities

    • 4 for districts

  • extract the layer you are interested in

Converting

Shape files can be converted here: https://mapshaper.org/

  • click select or drap and drop the files to the center area of the page (all 5 of the extracted files)

  • in the upload dialog click “Import“

    • If it gives you an error try reuploading it and in the upload dialog type “encoding=utf8“ in the text box

  • after import the page presents you with the map outline

  • you can click on “Export“

  • click “topoJSON“ or any other format you want in the dialog.

Extracting a Subset from a larger Map

If you can’t find the map you want online, you will have to extract a subset of features from a larger map. You can do this using the Open Source Sotware QGIS.

Installing QGIS

QGIS can be downloaded here: https://qgis.org/en/site/forusers/download.html

Extracting

  • after installation open up QGIS - an empty workspace will show up

  • click on the menu point “Layer“ and then “Add Layer“ and choose “Add Vector Layer“

  • in the dialog choose “File“ and select all 5 files of the layer (.shp, .shx, .cpg, .dbf, .prj)

  • right-click on layer in layer-panel and select “Filter“

  • enter a query into the textarea - you can use the left upper side of the dialog to find fields for the objects and the right upper side can display all values over the map in that field when you click “All“

"ADM0_NAME" IN ('Kenya', 'Ethiopia', 'Uganda', 'United Republic of Tanzania', 'Niger', 'Benin', 'Senegal', 'Ivory Coast') OR "ISO3" IN ('CIV')
  • after applying the query the selected layer will show up filtered

  • you can right-click it in the layer dialog on the left and click “Save as“

  • click browse to select a destination and a name

 

Selecting and unifying multiple features

  1. filter layer for features you want to unify

  2. select layer in layers panel and click on Vector → Geoprocessing Tools → Dissolve

  3. click ok in dialog → a new layer consisting of a single feature will now appear

  4. rename new layer to anything you want

  5. after all new layers have been added they have to be merged to one layer with multiple features

  6. click “Vector → Data Management Tools → Merge Vector Layers“

  7. in the dialog click on the button on “Input Layers“ and select your layers

  8. click run and then close

  9. on the new layer “Merged“ right-click and select “export → Save Features As“

Â