小编San*_*sen的帖子

使用R在OpenStreetMap上绘制纬度/经度点

我无法将头部包裹在投影上。我对北欧地区的看法最终指向中部非洲。

我的代码如下。

#Loading packages

library(OpenStreetMap)
library(rgdal)
library(ggplot2)

#defining world map
map <- openmap(c(70,-179), c(-70,179))
plot(map)

#Finding my work place in Northern Europe (Ørbækvej 100, Odense, Denmark from here: https://www.latlong.net/convert-address-to-lat-long.html)
subscr<-data.frame(lat=c(55.381640),
                   lon=c(10.433600))

#I am not sure what this does, but found on the web for a map in Germany: (https://gis.stackexchange.com/questions/209166/plotting-bubbles-on-top-of-openstreetmap-in-r) 
coordinates(subscr)<-~lat+lon
proj4string(subscr)<-CRS("+init=epsg:4326")
points(spTransform(subscr,osm()))
#as can be seen using this method the dot turns up in Eastern Africa


symbols(y = subscr$lon, x = subscr$lat, circles = 1, add = TRUE,
        inches = …
Run Code Online (Sandbox Code Playgroud)

gis r openstreetmap ggplot2

0
推荐指数
1
解决办法
1476
查看次数

标签 统计

ggplot2 ×1

gis ×1

openstreetmap ×1

r ×1