R 如何使用sf打印osm文件?
我试图使用R 如何使用sf打印osm文件?,r,openstreetmap,R,Openstreetmap,我试图使用plot\u sf从openstreemap打印shapefile,但我得到了一个空白打印。以下是我正在尝试的: library("osmdata") #> Data (c) OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright bb <- getbb("Sevilla") q <- opq(bb) q <- q %>% add_osm_feature(ke
plot\u sf
从openstreemap打印shapefile,但我得到了一个空白打印。以下是我正在尝试的:
library("osmdata")
#> Data (c) OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright
bb <- getbb("Sevilla")
q <- opq(bb)
q <- q %>% add_osm_feature(key = "highway", value = "motorway")
q1 <- opq_string(q)
dt <- osmdata_sf(q1)
sf::plot_sf(dt$osm_lines)
库(“osmdata”)
#>数据(c)OpenStreetMap贡献者,ODbL 1.0。http://www.openstreetmap.org/copyright
bb这对我有用。和你的差不多:
library(osmdata)
library(sf)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright
bb <- getbb("Sevilla")
q <- opq(bb)
q <- q %>% add_osm_feature(key = "highway", value = "motorway")
q1 <- opq_string(q)
dt <- osmdata_sf(q1)
plot(dt)
dt$osm_lines
plot(dt$osm_lines)
库(osmdata)
图书馆(sf)
#>数据(c)OpenStreetMap贡献者,ODbL 1.0。http://www.openstreetmap.org/copyright
实际上,我用了plot
而不是plot\u sf
。我再看一看。我在xy.coords(x,y,xlabel,ylabel,log)中发现了一个ploterror错误:'x'是一个列表,但没有组件'x'和'y'
我在sf
或osmdata
使用plot\u-sf
的包的文档中找不到任何东西。你能改用绘图吗?