Create a crop mask for map shapes
create_crop_mask.RdThis function generates a mask polygon that can be overlaid on a map to crop it to various shapes (circle, ellipse, etc.). The mask is a polygon with a hole in the desired shape.
Examples
bbox <- c(-0.1, 51.5, 0.1, 51.6)
result <- create_crop_mask(bbox, "circle", "#0a0e27")