Get a Country-specific World Map in QGIS

Wait 5 sec.

QGIS comes bundled with a simplified version of the Natural Earth Countries shapefile that is suitable for quick map-making. The layer can be loaded into your canvas by typing the keyword world in the coordinates bar. While this is useful, there is no single political map of the world that is accepted by every country of the world. There are many disputed international boundaries, and each country has its own version of accepted international boundaries. To allow mapmakers to adhere to local mapping regulations, Natural Earth also publishes Countries point-of-views shapefiles for many countries that depict the world map according to each country’s law and/or local conventions. We provide a simple script to replace the bundled world map with your country’s point-of-view layer.The script can be run from the QGIS Python Console. This is a one-time step that will ensure you get a locally compliant world map when you type world in the coordinates bar.Go to QGIS → Plugins → Python Console. Click Show Editor to open a blank file in the editor. Paste the following code. Change the country_code to the 3-digit ISO code for your home country and click Run Script.You can copy the code from the update_world_map.py or copy/paste from the block below.import geopandas as gpdfrom qgis.core import QgsPathResolver# Get the path to bundled the world_map.gpkg fileworld_map_gpkg_path = QgsPathResolver().readPath('inbuilt:/data/world_map.gpkg')world_map_gdf = gpd.read_file(world_map_gpkg_path, layer='countries')# Download Countries Point-of-Views shapefile # Choose your country codecountry_code = 'ind'# See all the available countries POV files at# https://www.naturalearthdata.com/blog/admin-0-countries-point-of-views/ne_pov_base_url = 'https://naciscdn.org/naturalearth/10m/cultural/'ne_pov_filename = f'ne_10m_admin_0_countries_{country_code}.zip'ne_pov_file_url = ne_pov_base_url + ne_pov_filenamepov_map_gdf = gpd.read_file(ne_pov_file_url)columns = ['NAME' ,'FIPS_10', 'ISO_A3', 'WB_A2', 'WB_A3', 'ISO_A2', 'geometry']# Select a subset of columns and rename to match the bundled layerpov_map_gdf_output = pov_map_gdf[columns].rename( columns={'FIPS_10': 'FIPS_10_', 'ISO_A2': 'iso_a2'})# Overwrite the bundled geopackage layerpov_map_gdf_output.to_file(world_map_gpkg_path, layer='countries', driver='GPKG', mode='w')iface.messageBar().pushSuccess( 'Update successful', f'World map updated with {country_code} pov boundaries')Once the script runs, you’ll now have a world map layer that is suitable for mapping according to your country’s local regulations. Note: The Countries Point-of-View layers are available for only selected countries. See the full list on the Natural Earth website.There are many useful (and fun) QGIS keywords such as world that trigger hidden features. These are known as Easter Eggs. You can check out our video to learn about all of them!