【发布时间】:2012-12-21 22:21:17
【问题描述】:
我尝试将具有多行的空间对象(从 OSM 检索到的河流)转换为 KML。对于具有单线的对象,使用 kmlLine 很容易。但是,使用多行时,以下方法不起作用,我尝试从 the documentation 调整示例是徒劳的:
# get OSM data:
library(osmar)
library(maptools)
salzach <- get_osm(relation(408582), full = T)
sp_salzach <- as_sp(salzach, what = "lines")
# convert to KML:
kmlLine(sp_salzach, "salzach.kml", lwd = 3, col = "blue", name = "Salzach")
Warning:
In kmlLine(sp_salzach, "salzach.kml", lwd = 3, col = "blue", name = "Salzach") :
Only the first Lines object with the ID '23633534' is taken from 'obj'
# shell.exec("salzach.kml")
【问题讨论】:
标签: r openstreetmap kml maptools osmar