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
filter layer for features you want to unify
select layer in layers panel and click on Vector โ Geoprocessing Tools โ Dissolve
click ok in dialog โ a new layer consisting of a single feature will now appear
rename new layer to anything you want
after all new layers have been added they have to be merged to one layer with multiple features
click โVector โ Data Management Tools โ Merge Vector Layersโ
in the dialog click on the button on โInput Layersโ and select your layers
click run and then close
on the new layer โMergedโ right-click and select โexport โ Save Features Asโ
ย