knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(saturnR)
library(mapview) # for plotting purposes

It is common to want to extract link data from UFS files to analyse it, to produce better looking reports or to send it to other design teams.

In those cases dumping data from UFS files can become tedius and mistake prone. The typical tools like batch files tend to be rigid and difficult to addapt.

Reading a simple file with read_ufs will dump all available variables from the UFS. Incomplete ufs file report warnings at the moment due to miss one or more columns (developing)

# As always we define our XEXES backend in this case 11.4
set_xexes("C:/Program Files (x86)/Atkins/SATURN/XEXES 11.4.07H MC X7/")

epsom_ufs <- saturnR_example("Epsom98oba.UFS")

ufs <- read_ufs(epsom_ufs, load_geometry = TRUE, selection_mode = "all_links", step = 1)

head(data.frame(ufs[,1:11])) #print the first few lines and columns

As we are obtaining the coordinates we can now export as a shp file

sf::st_write(ufs, "epsom.shp")

Or see the result on a leaflet map

mapview(ufs,zcol = "net_speed") #show the net speed in the map (directions overlapping in this example)


R-AECOM/SaturnR documentation built on Nov. 26, 2022, 2:46 p.m.