【发布时间】:2016-06-08 00:27:40
【问题描述】:
我有一系列坐标,我从中采样了数据,这是地图上的一个示例:
library(ggplot2)
library(ggmap)
library(dismo)
lon <- c(-64.723946, -64.723754, -64.723808, -64.724004)
lat <- c(32.350843, 32.350783, 32.350618, 32.350675)
df <- as.data.frame(cbind(lon,lat))
mapgilbert <- get_map(location = c(lon = mean(df$lon), lat = mean(df$lat)), zoom = 18, maptype = "satellite", scale = 2)
ggmap(mapgilbert) +
geom_point(data = df, aes(x = lon, y = lat, fill = "red", alpha = 0.8), size = 5, shape = 21) +
guides(fill=FALSE, alpha=FALSE, size=FALSE) +
scale_x_continuous(limits = c(-64.725, -64.723), expand = c(0,0)) +
scale_y_continuous(limits = c(32.350, 32.351), expand = c(0,0))
这是生成的图像:
我想在地图上的南北、东西两点之间画线 - 做一个加号。
但我希望这条线包含点,而不仅仅是一条线,所以我需要计算点的坐标。这些线大约有三十米,我需要每米一个点。我觉得 sp 包可能允许这样的事情,但我不知道如何。
谢谢,
凯兹
【问题讨论】:
-
尝试查看
oce::geodDist()。它也可能有帮助。
标签: r coordinates gis