After downloading the Natural Earth country and state/province shapefiles, unzip them into a directory and then cd
into that directory. Then merge the shapefiles into one file called merged.shp
by doing...
docker run -v $(pwd):/data geodata/gdal \
ogr2ogr \
-lco ENCODING=UTF-8 \
-f "ESRI Shapefile" \
merged.shp \
ne_50m_admin_0_countries/ne_50m_admin_0_countries.shp
docker run -v $(pwd):/data geodata/gdal \
ogr2ogr \
-lco ENCODING=UTF-8 \
-f "ESRI Shapefile" \
-update \
-append merged.shp ne_50m_admin_1_states_provinces/ne_50m_admin_1_states_provinces.shp \
-nln merged
Then generate the GEOJSON (selecting only a few properties of interest with the goal of reducing file size) by doing...
docker run -v $(pwd):/data geodata/gdal \
ogr2ogr \
-f GeoJSON \
-select NAME,ADM0_A3,TYPE \
-simplify 0.15 \
merged.geojson \
merged.shp