```r
# library(sf)
# library(mapview)
# setwd("big_data/os_grid/data")
# dir()
# fls<-dir(pattern="*RoadLink.shp")
# d<-st_read(fls[1])
# st_write(d,conn,"roads") 
# for(i in 2:length(fls)){
#  d<-st_read(fls[i])
# st_write(d,conn,"roads",append=TRUE)
# }
# 
# query<- "CREATE INDEX rd_ind ON roads USING GIST (geometry) "
# dbSendQuery(conn,query)
# 
# d<-st_read("WatercourseLink.shp")
# st_write(d,conn,"waterways")
# query<- "CREATE INDEX wt_ind ON waterways USING GIST (geometry) "
# dbSendQuery(conn,query)
#query<-"drop table if exists dorset_roads;create table dorset_roads as select r.* from roads r, dorset d where st_intersects(d.geometry,r.geometry); select * from dorset_roads"
#d<-st_read(conn,query=query)
# mapview(d)
# 
# fls<-dir(pattern="Water.*.shp")
# d<-st_read(fls[1])
# st_write(d,conn,"watercourse") 
# for(i in 2:50){
#  d<-st_read(fls[i])
# st_write(d,conn,"watercourse",append=TRUE) 
# }
```