Metadata-Version: 2.5
Name: dotted-map
Version: 0.1.0
Summary: Draw maps on which land is a regular lattice of dots, as SVG, PNG or PDF images
Project-URL: Documentation, https://dotted-map.readthedocs.io
Project-URL: Repository, https://github.com/xnx/dotted-map
Project-URL: Issues, https://github.com/xnx/dotted-map/issues
Project-URL: Changelog, https://github.com/xnx/dotted-map/blob/main/CHANGELOG.md
Author: Christian Hill
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: cartography,dots,graphic design,halftone,map,svg
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Requires-Dist: pyproj>=3.6
Requires-Dist: shapely>=2.0
Provides-Extra: cairo
Requires-Dist: cairosvg>=2.7; extra == 'cairo'
Description-Content-Type: text/markdown

# dotted-map

[![PyPI](https://img.shields.io/pypi/v/dotted-map)](https://pypi.org/project/dotted-map/)
[![Python versions](https://img.shields.io/pypi/pyversions/dotted-map)](https://pypi.org/project/dotted-map/)
[![Tests](https://github.com/xnx/dotted-map/actions/workflows/tests.yml/badge.svg)](https://github.com/xnx/dotted-map/actions/workflows/tests.yml)
[![Documentation](https://app.readthedocs.org/projects/dotted-map/badge/?version=stable)](https://dotted-map.readthedocs.io/en/stable/)

Draw maps on which land is a regular lattice of dots, as SVG, PNG and PDF
images for graphic design and infographics.

![A dotted map of the world, with eight cities marked in orange and joined by curved routes](https://raw.githubusercontent.com/xnx/dotted-map/main/docs/_static/world.png)

The maps are drawn in an equal-area projection, or any other that
[PROJ](https://proj.org) supports, with coastlines found from the fraction of
each dot's cell that is land. The land and country outlines of
[Natural Earth](https://www.naturalearthdata.com) are built in, so a country,
continent or subregion can be named to frame the map, to highlight it or to
draw it alone. The documentation is at https://dotted-map.readthedocs.io.

## Command line

```console
$ dotted-map -o world.svg
$ dotted-map --region France --highlight 'France=#0055a4' --colour '#c5cad3' -o france.png
$ dotted-map --region Italy --only Italy --shape hexagon --halftone -o italy.pdf
$ dotted-map --region GBR IRL --pin London=-0.13,51.51 --pin Dublin=-6.26,53.35 --arc London Dublin -o uk.svg
$ dotted-map --projection '+proj=ortho +lon_0=-30 +lat_0=30' --sea '#dde1e8' -o globe.svg
$ dotted-map --list-regions
```

## Python

```python
from dotted_map import DottedMap

m = DottedMap(region="Japan", width=600, spacing=8)
m.add_pin(139.69, 35.69)                # Tokyo.
m.save("japan.svg", colour="#bc002d", sea="#dde1e8", halftone=True)

data = m.to_dict()                      # Every dot, for use elsewhere.
```

Colours and sizes can be functions of longitude and latitude, for maps of
data.

## Installation

```console
$ pip install dotted-map
```

The dotted-map package needs Python 3.10 or later, NumPy, pyproj and Shapely.
PNG and PDF output also needs [CairoSVG](https://cairosvg.org)
(`pip install "dotted-map[cairo]"`) or the `rsvg-convert` program of
[librsvg](https://gitlab.gnome.org/GNOME/librsvg).

## Licence

BSD-3-Clause. The land and country outlines are made from Natural Earth's
1:50m data, which is in the public domain.
