Generate Random Sampling Points by Minimum Distance

Overview This document demonstrates how to generate random sampling points within a polygon while enforcing a minimum distance between points using a Simple Sequential Inhibition (SSI) process. Libraries library(sf) library(spatstat.geom) library(spatstat.random) library(dplyr) library(ggplot2) library(maptiles) library(ggspatial) library(units) We load: sf for modern spatial data handling spatstat modules for generating spatial point patterns ggplot2 for plotting maptiles and ggspatial for modern basemaps and map annotations units to safely handle distance units (e.g. metres) First, create a bounding polygon using longitude and latitude coordinates in the WGS84 coordinate system. While this format is convenient for defining locations, it is not suitable for measuring distances because the units are in degrees rather than metres. To address this, the polygon is reprojected into the British National Grid coordinate system (EPSG:27700), which uses metres as its unit. This transformation is essential for ensuring that the minimum distance constraint applied later is accurate and interpretable. You can of course use our own shapefile if you don’t want to manually create a bounding polygon. ...

March 25, 2026 · Anthony Caravaggi