Skip to content

regorxxx/Countries-Shapes-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Countries-Shapes-Generator

version CodeFactor Codacy Badge GitHub

A python script to generate country shapes in multiple projections compatible in size with world maps (i.e. meant to be used as layers). Output as png files. Designed to be used as an alternative to server-side JS libraries for world map rendering in some use-cases. Rendered files may be found here.

worldmap_shapes

Usage

Put all files into folder, for example at 'countries-shapes-generator'. Since every figure will be shown on the GUI, it's recommended to use an IDE which allows to show plots on its own window, like spyder-ide. Otherwise run on python:

python countriesShapesGenerator.py

As output multiple sub-folders will be created at the root, one per projection (should take +20 min):

image

Every country will have an associated file by its ISO 3166-1 alfa-3 code (i.e. Canada -> CAN). Also 2 world maps image files will be available: 'worldmap_shapes' and 'worldmap_natural'. They should be size-compatible with all the other files.

image

Python docstrings are available for all the functions. Output may be configured for any projection when importing the file as module and running the main function manually.

import countriesShapesGenerator as csg
import cartopy.crs as ccrs

csg.main(toPath = 'countries-Mercator\\', proj = ccrs.Mercator())

image

Real World Implementation

Selectable country shapes are used as layers over a world map background here:

  1. World-Map-SMP: displays current artist's country on the world map and lets you generate autoplaylists based on selection.

image

About

A python script to generate country shapes in multiple projections compatible in size with world maps (i.e. meant to be used as layers).

Topics

Resources

License

Stars

Watchers

Forks

Languages