> library(sp)
> library(maptools)
> library(raster)
> library(rgeos)
> maxd3 = readAsciiGrid("max.d3.txt") # 加载数据
> raster .maxd3 = raster(maxd3) # 转化为Raster
> maxd1 = readAsciiGrid("max.d1.txt")
> raster .maxd1 = raster(maxd1)
> raster .max.d3.d1 = raster .maxd3 - raster .maxd1 # 比较3天与1天的数据
> rc <- reclassify(raster .max.d3.d1, c(-Inf,0,1, 0,Inf,NA)) # 对比较结果进行分类,提取出 有问题的数据
> raster .maxRange = raster .maxd1>0 #提取范围
> maxRange = rasterToPolygons(raster .maxRange, dissolve=TRUE)
> cols = grey.colors(20, 0.1, 0.9, 2.2)
> image(rc, col=cols, useRaster=TRUE) #显示有问题的数据
> plot(maxRange, add=TRUE) #显示整个范围
继续阅读与本文标签相同的文章
-
奇葩设计师贾伟打开你的想象力经济
2026-05-18栏目: 教程
-
如何组建网络空间安全大赛
2026-05-18栏目: 教程
-
Jmeter四大随机数(一):$__Random(,,)
2026-05-18栏目: 教程
-
从零开始入门 K8s| 阿里技术专家详解 K8s 核心概念
2026-05-18栏目: 教程
-
移动办公OA科研项目管理解决方案
2026-05-18栏目: 教程
