Fmt
This commit is contained in:
parent
479ef92236
commit
c38d654ac7
44 changed files with 2526 additions and 701 deletions
|
|
@ -813,8 +813,14 @@
|
|||
],
|
||||
"source": [
|
||||
"# Build area lookup from both sets\n",
|
||||
"areas_before = {f[\"properties\"][\"postcode\"]: f[\"properties\"][\"area_sqm\"] for f in no_green[\"features\"]}\n",
|
||||
"areas_after = {f[\"properties\"][\"postcode\"]: f[\"properties\"][\"area_sqm\"] for f in with_green[\"features\"]}\n",
|
||||
"areas_before = {\n",
|
||||
" f[\"properties\"][\"postcode\"]: f[\"properties\"][\"area_sqm\"]\n",
|
||||
" for f in no_green[\"features\"]\n",
|
||||
"}\n",
|
||||
"areas_after = {\n",
|
||||
" f[\"properties\"][\"postcode\"]: f[\"properties\"][\"area_sqm\"]\n",
|
||||
" for f in with_green[\"features\"]\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"# Compute percentage removed\n",
|
||||
"diffs = []\n",
|
||||
|
|
@ -1161,16 +1167,23 @@
|
|||
"\n",
|
||||
"colormap = cm.LinearColormap(\n",
|
||||
" colors=[\"#ffffcc\", \"#fd8d3c\", \"#e31a1c\", \"#800026\"],\n",
|
||||
" vmin=0, vmax=min(max_pct, 90),\n",
|
||||
" vmin=0,\n",
|
||||
" vmax=min(max_pct, 90),\n",
|
||||
" caption=\"% area removed by greenspace\",\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# Show original boundaries, colored by how much was removed\n",
|
||||
"def style_by_removal(feature):\n",
|
||||
" pc = feature[\"properties\"][\"postcode\"]\n",
|
||||
" pct = diff_lookup.get(pc, 0)\n",
|
||||
" if pct <= 1:\n",
|
||||
" return {\"fillColor\": \"#cccccc\", \"color\": \"#999\", \"weight\": 0.5, \"fillOpacity\": 0.15}\n",
|
||||
" return {\n",
|
||||
" \"fillColor\": \"#cccccc\",\n",
|
||||
" \"color\": \"#999\",\n",
|
||||
" \"weight\": 0.5,\n",
|
||||
" \"fillOpacity\": 0.15,\n",
|
||||
" }\n",
|
||||
" return {\n",
|
||||
" \"fillColor\": colormap(min(pct, 90)),\n",
|
||||
" \"color\": \"white\",\n",
|
||||
|
|
@ -1178,6 +1191,7 @@
|
|||
" \"fillOpacity\": 0.6,\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"folium.GeoJson(\n",
|
||||
" no_green,\n",
|
||||
" name=\"Greenspace removal %\",\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue