## Mapping Environment Agency flood data from their API using Python to find at-risk postcodes

Given the recent storms and floods it seemed a good time to try something slightly new in python, calling an API. Specifically, I want to be able to call the Environment Agency flood warning API then map all areas with a flood warning and then extract a list of postcodes within those flood areas. Code …

## Building Bridges using Python

In a previous post I used NetworkX functions to convert a shapefile into a graph network for use in spatial smoothing. But there is a problem! Rivers and seas were un-crossable voids. I don’t really want to swim across the rivers, particularly the Thames, but luckily for us there are bridges across rivers and ferries …

## Spatial Smoothing using Network Analysis – Implementation

My previous post, network analysis and spatial smoothing, I investigated how to use NetworkX functions in python for potential use in spatial smoothing. In this post I’ll actually go over an example of the code being used to smooth average house price data across London. The code for this investigation is here The area being …

## Network Analysis and Spatial Smoothing

In my last post I introduced the concept of using network analysis for use on Road data. In another post I looked at using pygeos to spatially smooth data. This time I’ll be combining network analysis and spatial smoothing. The Problem Using distance related spatial smoothing, whether this is using kernel density or count/average within …

## Network Analysis in Python

Maps are all well and good, but do you know what’s better. Graphs! I’m not talking about pie charts or even bar charts I mean the ones with edges and vertices (also known as networks). In this post, and this code, I’m going to convert a geodataframe of A-roads around St Pauls into a graph …

## Generalising density functions using pygeos STRtree

In my post calculating spatial density in python generated three functions to generate different types of density measure. And in another post I tested the speeds of different nearest neighbour algorithms. These functions work, but onld for for point based geometries. In this post I’ll look at a more generalised set of functions to generate …

## Polygons Within A Radius in Python

In my posts on mapping so far I’ve focused on mapping points Nearest train station Met Office Data Spatial density Nearest neighbour speed tests This time I’ll be looking to generalise the last two points to polygons. i.e. can we find the distance from a point to the nearest polygon and the number of polygoins …

## Calculating spatial density in python

In previous posts I’ve found the nearest neighbour and plotted Met Office data using geopandas in python. Now it’s time to to calculate and visualise spatial density. I’ll do this in a way that was conceptually easy for me to understand and then switch to using spatial indexes to speed things up significantly. The code …

## Mapping Historic Met Office Data in Python

I recently discovered that the Met office publish historic HADUK datasets about historic weather patterns for the whole of the UK. They share a number of different types of weather data: Snow, rainfall, temperature…etc. at a lot of different scales: annual, seasonal, monthly, daily. I wanted to see what this data looks like in maps …

## How far is it to the nearest train station?

In a previous post I collected lots of different public data sources, imported them into python, made geopandas dataframes and made some simple maps. I now want to start some calculations. I’ve got some questions I want to answer. The first being For any postcode in the UK, how far is it to the nearest …