The Peer Groups for Local Authorities code on GitHub provides a way of comparing statistics between 'similar' local authorities.
NHS England have calculated a metric of similarity (Euclidean distance) based on standardised, normalised input features from Census 2021 data, including population demographics such as age, ethnicity and educational attainment.
The data includes a distance from sea calculation at Lower Layer Super Output Areas (LSOA) level.
This file provides the distance from sea for each LSOA that can be downloaded and used for running the code.
The distance from sea was calculated from the centroid of each LSOA to the coastline using the web app available at: https://www.doogal.co.uk/