I can not help you with the timeout on a historic datetime
; there may be a server side issue for all that I know (I get the same error, and your construction of the argument seems to follow documentation).
Regarding the other issues:
When working in the world of {sf}
I suggest to download your data via osmdata_sf()
call; it will be good for your sanity if you avoid mixing sf
and sp
worlds unless absolutely necessary.
The returned object will contain not only lines, but also points, polygons and (in your case empty) multi-type objects.
When working with cycle paths just select the osm_lines
object to a new variable; it will contain Sevilla bike paths with geometry of type linestring.
After checking it visually you can now save it as a ESRI Shapefile; note that this is an ancient file format, based on Ashton Tate dBase IV (a DOS program for Pete's sake :) and as such allows data column names of only limited number of characters, hence the warning.
library(osmdata)
library(dplyr)
library(sf)
sevilla <- opq('Sevilla') %>%
add_osm_feature(key = 'highway', value = 'cycleway') %>%
osmdata_sf()
names(sevilla) # note the points, polygons, multilines and multipolygons
# [1] "bbox" "overpass_call" "meta" "osm_points" "osm_lines"
# [6] "osm_polygons" "osm_multilines" "osm_multipolygons"
# just a single geometry type
sevilla_lines <- sevilla$osm_lines
# visual check of lines geometry only / does this look right?
plot(st_geometry(sevilla_lines))
# this will work, with the lines only
st_write(sevilla_lines, "sevilla.shp")
# Writing layer `sevilla' to data source `sevilla.shp' using driver `ESRI Shapefile'
# Writing 555 features with 34 fields and geometry type Line String.
# Warning message:
# In abbreviate_shapefile_names(obj) :
# Field names abbreviated for ESRI Shapefile driver
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…