Look ma!
(Almost)
no javascript!

David O’Sullivan, Geospatial Stuff

Making a tiled map

weavingspace is a python module developed for making tiled maps

github.com/DOSull/weaving-space

Uses geopandas and a lot of geometry, leveraging shapely

Implements many options (well over a hundred tilings and weave tiling patterns)

1import geopandas as gpd
2from weavingspace import TileUnit
3from weavingspace import Tiling

data = gpd.read_file("examples/data/imd-auckland-2018.gpkg")
tile = TileUnit(tiling_type = "cairo", spacing = 500, 
                crs = data.crs).inset_prototile(10)
tile.plot(r = 1, show_vectors = True)
1
geopandas adds ‘geometry’ to pandas dataframes.
2
A TileUnit stores geometry of a tiling and translation vectors so we can tile a map.
3
A Tiling is the result of applying a TileUnit to a geospatial dataset.

The tiling process

1tiling = Tiling(tile, data)
tiled_map = tiling.get_tiled_map(prioritise_tiles = True)

2tiled_map.legend        = False
tiled_map.ids_to_map    = list("abcd")
tiled_map.vars_to_map   = ["Rank_Emplo", "Rank_Crime", 
                           "Rank_Housi", "Rank_Incom"]
tiled_map.colors_to_use = ["Reds", "Blues", "Greens", "Greys"]

3tiled_map.render()
1
Make the tiling and get a map.
2
Set up a bunch of parameters for the final map.
3
Render.

Live demo time!

Questions?

github.com/DOSull/weaving-space

dosull.github.io/mapweaver/app/

dosull.github.io