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 …

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 …

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 …

Creating punctuation worksheet using python

I wanted to make some simple grammar worksheets based on an existing book, rather than making some up myself. So rather than just opening a book and typing them out I thought I’d use Python. This way you can personalise the worksheet to a book the kids like and has language at their level. To …