A CartoType map of the world’s coastlines created using OpenStreetMap coastline data is quite big: about 300Mb. You can create a much smaller one with the addition of country boundaries using Natural Earth data (https://www.naturalearthdata.com/downloads/), which has a public-domain license (https://www.naturalearthdata.com/about/terms-of-use/). You can also add one or more countries in full detail if needed.
Using medium-resolution Natural Earth data
If you use the medium-resolution data, designed for 1:50m scale, you’ll get a 37Mb CTM1 file. Use the command
makemap /extent=-180,-85,180,85 countries-50m.makemap
with this .makemap file (changing the file path as appropriate)
<?xml version="1.0" encoding="UTF-8"?>
<CartoTypeImportRules>
<file name='/natural_earth/50m_cultural/ne_50m_admin_0_countries.shp'>
<commit layer='outline'/>
<set name='name' value='ADMIN'/>
<set_int_low value='2'/>
<commit layer='boundary/major'/>
</file>
</CartoTypeImportRules>
The command-line given above clips the data at 85 degrees north and south to make the world map roughly square and avoid projection overflow in the default projection, Web Mercator. Many other projections like Equal Earth (/project=eqearth) don’t need any clipping.
Using Natural Earth data in other resolutions
You can use Natural Earth data at 1:10m (higher resolution than 1:50m) and 1:110m (lower resolution than 1:50m) by downloading the relevant files and changing ‘50m’ in the file names to ‘10m’ or ‘110m’. You’ll get maps that are about 89Mb and 22Mb respectively.
Adding a country at higher resolution and full detail
A common task is to show the whole world in outline, but draw a complete map of a selected country. Here’s an example of how you can do that, using Greece as the country to be shown in detail.
Get map data for Greece
Get OpenStreetMap data for Greece from https://download.geofabrik.de/europe/greece-latest.osm.pbf .
Create a .makemap file to get all the low-resolution country outlines except one
Here’s a .makemap file to get Natural Earth data for everywhere except Greece:
<?xml version="1.0" encoding="UTF-8"?>
<CartoTypeImportRules>
<file name='/natural_earth/50m_cultural/ne_50m_admin_0_countries.shp'>
<if test='ADMIN != "Greece"'>
<commit layer='outline'/>
<set name='name' value='ADMIN'/>
<set_int_low value='2'/>
<commit layer='boundary/major'/>
</if>
</file>
</CartoTypeImportRules>
Use the standard makemap file to get high-resolution coastlines
Here’s a .makemap file to get high-resolution coastline data, as explained elsewhere:
<?xml version="1.0" encoding="UTF-8"?>
<CartoTypeImportRules>
<file name='/coastlines-complete/land_polygons.shp'>
<commit layer='outline'/>
</file>
</CartoTypeImportRules>
Use this command line to create the map
Here’s the full makemap command line with an explanation of the parameters:
The command line:
osmconvert64 greece-latest.osm.pbf | makemap greece.ctm1 /project=eqearth /urbanareas=yes coastlines.makemap,17,34,31,43 -.osm countries_except_greece.makemap
The parameters:
osmconvert64 greece-latest.osm.pbf | makemap converts the .pbf file into .osm format. The vertical line sends the output to the following command, makemap. Use osmconvert, not osmconvert64, on platforms other than Windows.
greece.ctm1 is the name of the output file;
/project=eqearth chooses the Equal Earth projection;
/urbanareas=yes generates urban area shading automatically from the street density;
coastlines.makemap,17,34,31,43 imports high-resolution coastline data for the bounding box of Greece only, in degrees longitude and latitude;
-.osm is a special filename which means ‘read OSM data from standard input’;
countries_except_greece.makemap imports Natural Earth outline data for all the countries of the world except Greece.