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: mapshaper

  • 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: Download ยท QGIS Web Site

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โ€œ

ย