This function uses hand-crafted regular expressions to replace certain strings in the given SVG with the values given as arguments.

modify_usgs_pattern(
  pattern,
  width,
  alpha = 1,
  fill = "#ffffff",
  angle = 0,
  height = width
)

Arguments

pattern

svg text

width, height

size in pixels

alpha

opacity. default: 1. (opaque)

fill

default: '#ffffff'

angle

angle in degrees

Value

adjusted svg text

Details

This only really works because the SVG text that the USGS was derived from was relatively regular in layout/naming.