htdd_ashford: EtON roadworks data (raw HTDD logs from Elgin)

Description Format Examples

Description

This dataset represents eton data provided as a csv file by Elgin. Specifically it is a month's (June 2018) of data with almost 1000 records from Ashford, Kent. kent10 is a tiny subset of this dataset with 10 records. 'ashford_bng' is in the British National Grid CRS.

Format

A data frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Not run: 
d = "HDDT v2/"
list.files(d)
f = "elgin.htdd.export.20180601-20180630.csv.gzip"
file_path = file.path(d, f)
file.exists(file_path) # check the file is there
eton_all = rw_import_elgin_htdd(file_path)
ashford = osmdata::getbb("ashford uk", format_out = "sf_polygon")
library(sf)
ashford_bng = st_transform(ashford, 27700)
plot(ashford_bng)
eton_all_sf = st_sf(eton_all$e__location_bng)
sel_ashford = as.logical(st_intersects(eton_all_sf, ashford_bng, sparse = TRUE))
sel_ashford[is.na(sel_ashford)] = FALSE
summary(sel_ashford)
htdd_ashford = eton_all[sel_ashford, ]
nrow(htdd_ashford)
sel_non_standard = grepl("[[:cntrl:]]",
 stringi::stri_enc_toascii(htdd_ashford$e__location_description))
summary(sel_non_standard)

htdd_ashford$description =
  stringi::stri_trans_general(htdd_ashford$description, "latin-ascii")
htdd_ashford$e__location_description =
  stringi::stri_trans_general(htdd_ashford$e__location_description, "latin-ascii")
htdd_ashford$i__permit_condition =
  stringi::stri_trans_general(htdd_ashford$i__permit_condition, "latin-ascii")
htdd_ashford$i__location_description =
  stringi::stri_trans_general(htdd_ashford$i__location_description, "latin-ascii")

## End(Not run)
names(htdd_ashford)
sapply(htdd_ashford, class)
plot(htdd_ashford$e__location_bng)
plot(htdd_ashford$i__start_date)

ITSLeeds/roadworksUK documentation built on May 31, 2019, 5:18 p.m.