Plot a series of places on a map in the style of a Voronoi diagram, based on an input csv file formatted in the following style (columns in this order - the column header names do not matter):
Labels / Places | Y-Coord / Latitude | X-Coord / Longitude | Colour Place / Been to Place |
---|---|---|---|
England | 52.3555 | -1.1743 | Y |
Isle of Man | 54.2361 | -4.5481 | N |
N Ireland | 54.7877 | -6.4923 | N |
Scotland | 56.4907 | -4.2026 | Y |
Wales | 52.1307 | -3.7837 | Y |
Clone the voronoi-mapper
repo to your area. Note you may need to set up ssh keys and add them to your GitHub account first, see here.
git clone [email protected]:GluonicPenguin/voronoi-mapper.git
voronoi-mapper
uses a conda installer, with the conda environment set up in Miniconda. To set up Miniconda3 and install the mapper requirements, do the following:
MINICONDA_DIR=/path/to/miniconda3 # change this to somewhere outside the voronoi-mapper repo
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $MINICONDA_DIR # this creates the miniconda3 directory at the known /path/to
rm Miniconda3-latest-Linux-x86_64.sh
source $MINICONDA_DIR/etc/profile.d/conda.sh
conda update -y -n base -c defaults conda
export PYTHONNOUSERSITE=true
Then back in your voronoi-mapper
directory, set up the environment:
conda env create -f mapper_env_requirements.yml
conda activate voronoi_mapper_env
In future setups, use the setup_env.sh
file to start up the voronoi-mapper
environment. Note that you will need to change the first line to the MINICONDA_DIR
.
voronoi-mapper
takes two positional arguments: the input csv file and the output file name and path. An optional argument for the output plot type, e.g. pdf or png, is available (default is png). For example:
python voronoi_mapper.py /path/to/places.csv /path/for/places_plot
The result should look like the following:
voronoi-mapper
can be modified at the dataframe stage to any format that will appear at the Voronoi diagram creation stage. The options currently are:
-f, --fisheye some_label # choose to magnify the diagram about a central point or label, good if there are a lot of places clustered together in one area