Running the layer mapping 

At the bottom of load.py, create a function called run that contains the following code. Note that the names of the mappings (for example, us_states_mapping) will have to match the names of the dictionaries:

def run(verbose=True):    lm = LayerMapping(        US_States, states_shp, us_states_mapping,        transform=False, encoding='iso-8859-1',    )    lm.save(strict=True, verbose=verbose)    lm = LayerMapping(        Counties, counties_shp, us_counties_mapping,        transform=False, encoding='iso-8859-1',    )    lm.save(strict=True, verbose=verbose)    lm = LayerMapping(        Districts, districts_shp, districts_mapping,        transform=False, encoding='iso-8859-1',    )    lm.save(strict=True, verbose=verbose)    lm = LayerMapping(        Arenas, arenas_shp, arenas_mapping, transform=False, ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.