Computes the azimuth and length for every sub-segment (i.e. the line between two successive vertices) and then takes a length-weighted average of all sub-segments. Typically used within a purrr `map` function.

st_avg_line_azimuth(linestring, coord_local)

Arguments

linestring

Input linestring (from sf)

coord_local

Local coordinate system EPSG code of input linestring

Value

Average azimuth in decimal degrees