import geopandas
import topojson
import matplotlib.pyplot as plt18 Brexit
18.2 Topology simplification
To obtain a much more lightweight set of geometries, we simplify the layer, respecting its topology. First we build the topology:
topology = topojson.Topology(lads)Then simplify it:
simple_uk = topology.toposimplify(.025)Inspect the resulting geography:
simple_uk.to_gdf().plot()And we can write it to a GeoJSON file:
simple_uk.to_gdf().to_file('./local_authority_districts.geojson', driver="GeoJSON")18.3 Download link
- {download}
[Download the simplified LAD geometries as a GeoJSON] <local_authority_districts.geojson> - {download}
[Download the EU referendum vote results as a CSV] <brexit_vote.csv>