惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
GRAHAM CLULEY
V
V2EX
WordPress大学
WordPress大学
博客园 - Franky
Last Week in AI
Last Week in AI
博客园 - 司徒正美
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
V
Visual Studio Blog
C
CERT Recently Published Vulnerability Notes
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
腾讯CDC
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
A
Arctic Wolf
量子位
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
News and Events Feed by Topic
雷峰网
雷峰网
博客园_首页
Google Online Security Blog
Google Online Security Blog
Spread Privacy
Spread Privacy
罗磊的独立博客
H
Hacker News: Front Page
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
IT之家
IT之家
The Cloudflare Blog
爱范儿
爱范儿
博客园 - 叶小钗
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell

遐说

2026第一场日出日落-黄山 [徒步]宁波九龙爱心线 [徒步]仙居公盂徒步+丽人谷溯溪(多图) 文献引用批量标注蓝色-Zotero/EndNote [出差]内蒙草原风光 [徒步]浙东小九寨 [徒步]西湖小猫线 微软Office365家庭版拼车5年180 2024浏阳跨年烟火 一路向北-广西 落日余晖——武汉东湖 博士论文盲审通过 青海出差 我开盒了我自己 hexo-butterfly+artalk无法显示文章PV浏览次数 记某站字体混淆解析方案 记第一次进藏 2024川西大环线 Python读取NetCDF文件-裁剪&计算 2024武汉东湖樱花园 zotero批量修改条目语言解决”等”和”et al”混排问题 torch_geometric_temporal安装报错找不到to_dense_adj 武汉冻雨&乡村春节 云南镇雄县凉水村滑坡:卫星影像解析 博客聚合平台RSS订阅-BlogFinder&博友圈&十年之约 腾讯云CDN正式取消免费10G流量包 2023跨年闲逛武汉 观感|小米SU7技术发布会 【留痕】解密微信聊天记录工具:年度报告、聊天导出一键搞定! 小米电脑管家 vs. MIUI+: 手机与PC协同体验大比拼! Waline私有化部署(Docker+VPS) rclone数据同步使用记录(OneDrive+COS+AList) 科研绘图工具 秋意渐浓 Docker buildx交叉编译Python记录 Word分章节图片公示编号方法 Lightroom+Google Map生成个人足迹 评论|如何看待面青地项目允许博士后变更依托单位 Memos添加utterances评论区 收到明信片啦! [Adobe]Your Adobe app is not genuine解决方案-Clash版 尝试配置PicGo-Core日志输出等级 巴东三峡巫峡长 摄影|东湖绿道 旅行|彩云之南 超实用的铁路地图网站 新冠首阳 树莓派netplan连接开放网络(无密码WIFI) 周末|流浪地球2|维也纳展映 维也纳黄昏&夜景 Sony A7M4/M3欧版解锁多国语言 周末|Prater公园|夜景 快乐五一|布拉格Praha 周末|Melk小镇一日游 CDN流量太贵?图床图片批量压缩替换 维也纳|生活感受|交通|物价|通货膨胀 GitHub Remark|给Gay Hub的小伙伴加备注 周末自制烤冷面-不想干活 布达佩斯|匈牙利游记(多图) Notion2Markdown联动发布Hexo博客-自动化部署方案 SPI/TWI水文参数计算公式-ArcGIS Pro 【再见】难得是欢聚, 最是离别多 拯救者R9000P氮化镓电源适配器测评 今天你的华为P30无限重启了吗? pyTranscriber字幕生成软件(带代理版本) Adobe Illustrator错误代码160解决方案 EndNote导入PDF文件关联(SCI-RIS-Helper)插件 ZED-F9PK4 RTK GNSS模块使用指南 pyeemd安装教程--win10 wsl + ubuntu 樱花草 - 小学回忆 咸九高速-幕阜山扶贫攻坚重点项目 NXP i.MX6ULL平台Nodejs & npm 安装教程 全国分省12.5米DEM数字高程数据(ALOS 12.5m)下载 2018&2010全国四级行政区划(省-市-区/县-街道/乡镇)c 全国/湖南省/浙江省水文监测站基本数据&湖北省水文观测站历史数据 天舟二号发射成功 解决方案:Grammarly for Word 无法使用 SDZM: Software for determining shear failure regions of rock joints CNKI知网油猴插件-一键导入Endnote&下载PDF RSS 订阅地大新闻 - CUG News Word 公式字体替代方案 ArcGIS License Manager 无法启动 - Sorry, this application cannot run under a virtual machine html table 批量转 Excel(xlsx) ImageColorAnalysisTool-图像颜色分析工具-Matlab GUI版 matlab柱状图(bar)转折线图(line)方案 图像主要颜色分析工具(pyImageColorAnalysisTool) 科研资料备份同步方案(FreeFileSync) 海量文献自定义格式整理方法(EndNote) CUG校外访问内网网站方法(官方VPN) 通过三个点绘制三维圆弧-python 记挖竹笋 日常实用小软件 长江流域三峡库区水情水位信息获取 EndNote导入文献期刊名-J无法识别解决方案 pymongo 使用记录 Redis学习记录 Laravel 5.6 学习记录 文件名批量提取工具介绍及使用教程 win7x64 下 redis 的安装 CI框架常用数据库操作技巧
GRASS斜坡单元分割插件(r.slopeunits) windows移植方案
Dorad · 2023-05-16 · via 遐说

发表于|更新于|科研GIS

|总字数:2.1k|阅读时长:10分钟|浏览量:|

最新上线付费视频教程,包含 GRASS+Windows 平台下 r.slopeunits 的移植、斜坡单元分割操作实录以及关键点讲解,有需要的同学可点击这里

该插件由意大利@Massimiliano 基于 GRASS 平台开发,用于快速划分斜坡单元。

原作者只适配了 Ubuntu 系统,而未适配 windows,而本人尝试使用后发现并不好使,故想办法移植到 Windows 下使用。

由于花费了不少心思摸索,故记录,方便下次查阅&分享。

¶快速开始

¶QGIS 安装

  • 确保自己安装了最新版本的 QGIS,GRASS 会一同被安装。

  • 安装完成后,检查目录下是否有 GRASS 程序,程序应位于 QGIS/APP 目录下,例如:D:\Program Files\QGIS 3.22.4\apps\grass\grass78\

¶安装 r.slopeunits

  • 在官方网站下载slu_grass78.tgz,并从中提取r.slopeunits文件,重命名为r.slopeunits.py

  • 得到r.slopeunits.py文件后,复制到D:\Program Files\QGIS 3.22.4\apps\grass\grass78\scripts路径(根据自己的安装目录修改)下。

¶Windows 适配

D:\Program Files\QGIS 3.22.4\apps\grass\grass78\bin目录下,创建r.slopeunits.bat文件,内容如下:

1
@"%GRASS_PYTHON%" "%GISBASE%/scripts/r.slopeunits.py" %*

¶试运行

运行 GRASS GIS 即可,在 GUI 下即可调用 r.slopeunits 进行斜坡单元分割。

试运行效果

GRASS 中,调用命令之前记得先调用 r.region 设置边界,否则可能输出结果为空,详情见r.region - GRASS GIS manual (osgeo.org)

插件详细的参数含义可根据r.slopeunits —help的内容查看,并进行调整,内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
r.slopeunits --help
Create a raster layer of slope units
Usage:
r.slopeunits.py [-mn] demmap=name [plainsmap=name] slumap=name [slumapclean=name] [circvarmap=name] [areamap=name] thresh=value areamin=value [areamax=value] cvmin=value rf=value maxiteration=value [cleansize=value] [--overwrite] [--help] [--verbose] [--quiet] [--ui]
Flags:
-m Perform quick cleaning of small-sized areas and stripes
-n Perform detailed cleaning of small-sized areas (slow)
Parameters:
demmap Input digital elevation model
plainsmap Input raster map of alluvial_plains
slumap Output Slope Units layer (the main output)
slumapclean Output Slope Units layer (the main output)
circvarmap Output Circular Variance layer
areamap Output Area layer; values in square meters
thresh Initial threshold (m^2).
areamin Minimum area (m^2) below whitch the slope unit is not further segmented
areamax Maximum area (m^2) above which the slope unit is segmented irrespective of aspect
cvmin Minimum value of the circular variance (0.0-1.0) below whitch the slope unit is not further
segmented
rf Factor used to iterativelly reduce initial threshold: newthresh=thresh-thresh/reductionfactor
maxiteration maximum number of iteration to do before the procedure is in any case stopped
cleansize Slope Units size to be removed

¶GUI 操作

r.slopeunits的作者非常贴心,还给设计了 UI 界面来实现无代码操作,直接在控制台输入r.slopeunits即可调用。

GUI界面-r.slopeunits

¶分割效果

采用 r.slopeunits 成功分割得到的结果为栅格格式输出,每个类别有一个 ID,渲染效果如下:

r.slopeunits的分割效果

¶Q&A

近期不少同学发邮件私信我各类疑难杂症,在此总结回复。

  • 可供参考的命令行?

本文使用的命令行参数如下,供参考:

1
r.slopeunits demmap=DEM_FILL@PERMANENT slumapclean=SluMapC@PERMANENT slumap=SluMap@PERMANENT thresh=50000 areamin=2000 cvmin=0.25 rf=10 maxiteration=5 --overwrite
  • 命令行已经可以调用r.slopeunits,但是输出结果是空白?

请检查g.region是否提前调用,要设置成DEM一样的范围;另外,多试一些参数,调参,可能是参数不正确,具体参考原论文的参数。

1
g.region raster=DEM_FILL@PERMANENT
  • 执行报错?

检查一下DEM 的坐标系是否为WGS 84/UTM坐标系,使用g.region -p查看当前的参数信息是否正确。

正常进行一个县级行政区 30 米精度的分割耗时在 5 分钟以内,可作为参考。

一般采用 30 米或 12.5 米精度的数字高程(DEM)作为源数据进行分割,DEM 下载可看博主此前文章

以下是正常执行时的运行日志,供参考:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(Tue Jan 16 17:27:34 2024)
r.slopeunits demmap=DEM@PERMANENT slumapclean=SluMapC@PERMANENT slumap=SluMap@PERMANENT thresh=50000 areamin=2000 cvmin=0.25 rf=10 maxiteration=5 --overwrite
Initial threshold (cells) is : 58
Initial minimum area (cells) is : 2
WARNING: MASK already exists and will be overwritten
Univar: 1199471
Threshold (hectars) is: 4.4089525877448645
No. of cells to be still classified as SLU is: 312522. Loop done: 1
Univar: 21531
Threshold (hectars) is: 3.9002272891589187
No. of cells to be still classified as SLU is: 290991. Loop done: 2
Univar: 20984
Threshold (hectars) is: 3.4762895403372966
No. of cells to be still classified as SLU is: 270007. Loop done: 3
Univar: 19656
Threshold (hectars) is: 3.052351791515675
No. of cells to be still classified as SLU is: 250351. Loop done: 4
Univar: 20405
Threshold (hectars) is: 2.7132015924583777
No. of cells to be still classified as SLU is: 229946. Loop done: 5
Removing temporary files
(Tue Jan 16 17:29:25 2024) Command finished (1 min 51 sec)
  • r.slopeunits参数选取 or 使用问题

如果已经可以调用r.slopeunits —help,说明移植已经成功,本教程目的已经达到;剩下的就是调参和各类 GRASS 软件的使用问题,不在本文章讨论范围;此类问题可以在评论区提问(博主会收到邮件通知),但请尽量不要发送邮件私信,感谢。

  • 私信&咨询&求助?

由于处于关键人生阶段(撰写毕业论文 ing…),时间有限,博主暂无法一一回复各类疑难杂症。

  • 视频教程?

应各位同学要求,录制了全操作流程的视频教程,付费授权观看,详见:付费视频教程

¶其它

使用该插件的同学应该都是做滑坡易发性评价相关的研究,如果此文帮到了你,方便的话可以引用以下论文,感谢!

  • Xia, D., Tang, H., Glade, T., Tang, C., & Wang, Q. (2024). KNN-GCN: A Deep Learning Approach for Slope-Unit-Based Landslide Susceptibility Mapping Incorporating Spatial Correlations. Mathematical Geosciences. https://doi.org/10.1007/s11004-023-10132-3

  • Xia, D., Tang, H., Sun, S., Tang, C., & Zhang, B. (2022). Landslide Susceptibility Mapping Based on the Germinal Center Optimization Algorithm and Support Vector Classification. Remote Sensing, 14(11), 2707. https://doi.org/10.3390/rs14112707

KNN-GCN: A Deep Learning Approach for Slope-Unit-Based Landslide Susceptibility Mapping Incorporating Spatial Correlations - Mathematical Geosciences

Landslides pose a significant risk to human life and property, making landslide susceptibility mapping (LSM) a crucial component of landslide risk assessment. However, spatial correlations among mapping units are often neglected in statistical or machine learning models proposed for LSM. This study proposes KNN-GCN, a deep learning model for slope-unit-based LSM based on a graph convolutional network (GCN) and the K-nearest neighbor (KNN) algorithm. The model was experimentally applied to the Lueyang region and validated through the following steps. Firstly, we collected data for 15 landslide causal factors and from landslide inventories and established a slope unit map (SUM) through slope unit division. Next, we performed a multicollinearity analysis of landslide causal factors and divided the training and test sets at a 7:3 ratio. We then constructed a GCN model based on a slope unit graph (SUG) generated from the SUM using the KNN algorithm. The proposed KNN-GCN model was tuned using a grid search with fivefold cross-validation on the training set, and then trained and validated on training and test sets separately. Finally, the performance of the KNN-GCN model was compared with that of six other models which were categorized into two groups: CG#1 was the traditional KNN, support vector regression (SVC), and automated machine learning (AutoML), and CG#2 included KNN-G, SVC-G and AutoML-G with additional spatial information. Our results demonstrate that the proposed model achieves superior performance (area under the curve [AUC] = 0.8351) and generates the most comprehensible susceptibility map with distinct boundaries between different susceptibility levels. Notably, while the proposed KNN-GCN model displays exceptional performance in slope-unit-based LSM, its implementation requires high-level computing resources, and it is not recommended for small datasets.

https://link.springer.com/article/10.1007/s11004-023-10132-3

Landslide Susceptibility Mapping Based on the Germinal Center Optimization Algorithm and Support Vector Classification

A landslide susceptibility model based on a metaheuristic optimization algorithm (germinal center optimization (GCO)) and support vector classification (SVC) is proposed and applied to landslide susceptibility mapping in the Three Gorges Reservoir area in this paper. The proposed GCO-SVC model was constructed via the following steps: First, data on 11 influencing factors and 292 landslide polygons were collected to establish the spatial database. Then, after the influencing factors were subjected to multicollinearity analysis, the data were randomly divided into training and testing sets at a ratio of 7:3. Next, the SVC model with 5-fold cross-validation was optimized by hyperparameter space search using GCO to obtain the optimal hyperparameters, and then the best model was constructed based on the optimal hyperparameters and training set. Finally, the best model acquired by GCO-SVC was applied for landslide susceptibility mapping (LSM), and its performance was compared with that of 6 popular models. The proposed GCO-SVC model achieved better performance (0.9425) than the genetic algorithm support vector classification (GA-SVC; 0.9371), grid search optimized support vector classification (GRID-SVC; 0.9198), random forest (RF; 0.9085), artificial neural network (ANN; 0.9075), K-nearest neighbor (KNN; 0.8976), and decision tree (DT; 0.8914) models in terms of the area under the receiver operating characteristic curve (AUC), and the trends of the other metrics were consistent with that of the AUC. Therefore, the proposed GCO-SVC model has some advantages in LSM and may be worth promoting for wide use.

https://www.mdpi.com/2072-4292/14/11/2707

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 遐说