Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何使用sf打印osm文件?_R_Openstreetmap - Fatal编程技术网

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)中发现了一个plot
error错误:'x'是一个列表,但没有组件'x'和'y'
我在
sf
osmdata
使用
plot\u-sf
的包的文档中找不到任何东西。你能改用
绘图吗?