- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个使用以下命令绘制的 SpatialPolygonsDataFrame:
spplot(milanoNILNew, "percPolVita",at = c(0,0.0696,0.08979,0.0974,0.1116,0.181),col.regions =pal,main="Quota Clienti Unipol con Polizze Vita ")
agenziePoints<-SpatialPointsDataFrame(coords=datiAgenzie[,c("Long","Lat")],data=datiAgenzie,proj4string = llCRS, match.ID = TRUE).
最佳答案
只需使用带有 add=TRUE 参数的基本绘图函数即可。
require(sp)
# Create polygons
sr=SpatialPolygons(list(
Polygons(list(Polygon(cbind(c(180114,180553,181127,181477,181294,181007,180409,
180162,180114),c(332349, 332057, 332342, 333250, 333558, 333676, 332618, 332413, 332349)))),"1"),
Polygons(list(Polygon(cbind(c(180042,180545,180553,180314,179955,179142,179437,179524,179979,180042),
c(332373,332026,331426,330889,330683,331133,331623,332152,332357,332373)))),"2")))
srdf=SpatialPolygonsDataFrame(sr, data.frame(cbind(1:2,1:2), row.names=c("1","2")))
# Add points (sp meuse dataset)
data(meuse)
coordinates(meuse) = ~x+y
# Create a color vector for the meuse points
color <- rep("xx", nrow(meuse@data))
color[(meuse@data$copper > 0)&(meuse@data$copper <= 31)] <- "black"
color[(meuse@data$copper > 31)] <- "red"
# Plot polygons with points overlaid
plot(srdf, col=c("grey","blue"))
plot(meuse, col=color, pch=19, add=TRUE)
# spplot approach
pts=list("sp.points", meuse, pch=19, col=color)
spplot(srdf, "X1", col.regions=c("grey","blue"), colorkey=FALSE,
sp.layout=list(pts))
关于r - 在 SpatialPolygonsDataFrame 上绘制 SpatialPointsDataFrame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23547445/
我正在尝试将与 bat 位置 (SpatialPointsDataFrame) 相关的数据叠加到科罗拉多州 (SpatialPolygonsDataFrame) 上。两个对象的CRS不同: crs(c
我正在尝试将与 bat 位置 (SpatialPointsDataFrame) 相关的数据叠加到科罗拉多州 (SpatialPolygonsDataFrame) 上。两个对象的CRS不同: crs(c
我必须沿着一个曲折的特征来克里格值。因此,我必须将正常的笛卡尔坐标 (x,y) 转换为曲线坐标系 (s,n)。曲线坐标允许我进行克里格法,在克里格法之后,我可以将坐标反转为笛卡尔 x,y 以便表示原始
使用sp R 中的包。我想知道何时使用 SpatialPoints 以及何时使用 SpatialPointsDataframe。我觉得没有太大区别?! 唯一的区别是在 SpatialPointsDat
我有一个 SpatialPointsDataFrame,它有一个属性(为了方便起见,我们称之为 z)以及纬度/经度坐标。 我想将其写入 XYZ 文件(即具有三列的 ASCII 文件)。 最初我试过 w
我有一个 SpatialPointsDataFrame 加载 pst500),nrow(coord)) # check position of breaks breaks = c(1,which(li
我有一个使用以下命令绘制的 SpatialPolygonsDataFrame: spplot(milanoNILNew, "percPolVita",at = c(0,0.0696,0.08979,0
我需要将 R data.frame 对象转换为 SpatialPointsDataFrame 对象,以便对数据运行空间统计函数。但是,出于某种原因,将 data.frame 对象转换为 Spatial
我正在尝试使用 sp 完成的任务非常简单。 R 中的包,但我正在努力学习 sf因此我的问题。我试图在 R 中创建一个点的形状。我有很多点,所以它必须是有效的。我在 sp 中都成功做到了和 sf但是 s
我想要做的任务非常简单,使用 R 中的 sp 包,但我正在尝试学习 sf 因此我的问题。我正在尝试在 R 中创建点的形状。我有很多点,所以它必须高效。我已经在 sp 和 sf 中成功完成了此操作,但
我正在致力于运行 RandomForest。我已经导入了代表已使用和未使用站点的点数据,并从栅格 GIS 图层创建了一个栅格堆栈。我创建了一个 SpatialPointDataFrame,其中包含我所
我正在使用 HURDAT 数据集绘制飓风轨迹。 我目前在 R 中生成了一个 SpatialPointsDataFrame 对象,它在 2004 年看起来像这样。 > str(cluster.2
我一直在关注 this workflow将坐标从东/北转换为 R 中的纬度/经度。直到今天它一直工作正常。这是一个可重现的示例: require(rgdal) # create test coordi
我在 R 中有一个 SpatialPointsDataFrame,如下所示: coordinates id order hole piece group box_id
我使用 R 使用 ggplot2 形式的大圆圈在世界地图上投影一些数据流。 我还想在我的 map 上投影城市区域: http://www.naturalearthdata.com/downloads/
我想使用 ggmap 创建 map 。我想显示一些点的位置,从带有 UTM 坐标的数据框开始。但是,我总是以错误消息结尾:“错误:ggplot2 不知道如何处理 SpatialPointsDataFr
我正在尝试将 1000x1000 米正方形的 SpatialPointsDataFrame(网格)与 SpatialPolygonsDataFrame(信息)结合起来,以聚合每个网格正方形内点的所有信
我是一名优秀的程序员,十分优秀!