Quantum GIS(QGIS)是开源地理信息系统桌面软件, 使用GNU(General Public License)授权,属于 Open Source eospatial Foundation(OSGeo)的官方计划。 在 GNU 授权下,开发者可以自行检阅与调整程序代码,并保障让所有使用者可以免费且自由地修改程序。
QGIS 的目标是成为一个 GIS系统,提供常见的功能与特征。借着核心特征提供基本功能与附加组件(Python 或 C++) 持续地扩充,让使用者可以浏览、管理、编辑、分析数据以及制图。
QGIS 是一群自愿者所开发的项目,为程序代码提供缺陷修复、报告以及文件等贡献。 它是由热心的使用者和开发社群所维护的。它提供了交互式的邮件列表, 以及通过网络管道传达给其他用户与开发人员帮助与建议。另外,它也提供商业定制化开发。
QGIS项目开始于2002年5月,是基于跨平台的图形工具Qt软件包,采用C++ 语言开发的一个GIS软件。 目前的开发非常活跃,当前Windows(2020年)的最新版本是QGIS 3.12版。
参考来源:Q3基础教程
快捷键
ctrl+D
remove layer or groupctrl+L
Data Source Manager
矢量平移
- 将投影转移到平面投影(epsg:3857)
vector geometry
–>translate
shp等格式转换
KML 转 Shape
Open up the installed QGIS.
Select Layer in the menu bar and press Add Vector Layer or select the shortcut icon. Browse the KML file, in the Source DataSet type, in the pop up window opened.(While browsing, select either all files or Key Hole Markup language in file type). And press Open.
select layer from the menu and click on save as.
In the Save vector layer as window, Select the format from the drop down box as ESRI Shapefile(OGR) and browse the folder in which you want to save the shapefile. Name it and Press OK.
Reference: 1
Shape 转 kml
- Open up the installed QGIS.
- In the menu bar, select Layer and press Add Vector Layer. Now select the source type in the pop up window opened as File and browse the source Shapefile(Note:Your shapefile .shp, .dbf and .shx file should be in same folder). Press open.
- Right click on the name of Shapefile layer Appearing in the Left upper side and select save as:
or
You can select layer from the menu, and click on save as. (Image below provide demonstrate both the options with the indicator displayed) - In the Save vector layer as window, Select the format from the drop down box as Keyhole Markup Language(KML) and browse the folder in which you want to save the KML file . Name it and Press OK.
Your KML file will be Exported in the directed folder. You can Verify the generated KML file for its validity by uploading the generated KML file to QGIS or uploading KML file in Google map. You may soon find the tool and the coding for the same on this site.
- Reference: 1
导入谷歌、高德等地图卫星影像
- 安装QuickMapServices插件
打开QGIS,在菜单Plugins中选择Manage and Install Plugins…
搜索QuickMapServices,选中并点击Install,等待即可完成安装。
安装好后会在工具栏显示三个图标,选择带➕号的那个,打开即可看到大量底图,单击即可导入。
有些朋友可能发现底图并没有图片上展示的这么多,这是由于部分底图需要额外获取,选择底部的Settings→More services→Get contributed pack,即可完成获取。
批量替换字段值
- open attribute table (
F6
) - open field calculator (
CTRL + I
) - Inverse select
create a new field
and Input follow expression
1 | replace("地类",'裸地','植被') |
Note that the double quotes indicate a field name while the single quotes refer to a static string. These are not interchangeable.
参考文献:
地物分类统计插件
Plugins
-> Manage and Install Plugins...
->
搜索 并 安装 Group Stats
然后在 Vector
下找到 并 使用
Rows
: 地类Columns
: SumValue
: Area
点击 Calculate
,结果在左上角,可点击 Data
另存为 *.CSV
文件。
参考文献:
矢量编辑
矢量裁剪
增加矢量图形
- 单击
编辑
(铅笔形状
)按钮,切换到编辑状态 - Add Polygon feature (
ctrl+.
)
矢量挖洞
- 在大矢量范围内,增加一个矢量(需要挖掉的范围)
Vector
菜单,->Geoprocess Tools
,->Difference
调整矢量边界大小
- 单击
编辑
(铅笔形状
)按钮,切换到编辑状态 - Vertex Tool (),点一下,拖动到合适位置
编辑矢量要素
- 加载矢量文件
- 单击
编辑
(铅笔形状
)按钮,切换到编辑状态 - 在
编辑
下拉菜单里面选择要进行的操作
例如 我希望在面要素里面划出一个空洞,
选择添加环工具
在选定的面要素上,画一个面,双击结束。最终形成一个带有空洞的面。
那么这个空洞又如何自动消除呢?
- 在处理工具箱的搜索栏里面搜索关键词
删除空穴
- 选择处理路径及名称
- 点击保存后运行
参考来源:白衣探马陈庆之
线状转面状地物
- 选择处理工具箱中的:
矢量几何图形
- 选择工具:
多边形化
- 输入存储面的信息
- 运行
计算周长和面积
打开字段计算器,选择新列并键入以下表达式
1 | 对于区域:$area |
设置测量默认单位
- 新建工程,打开
设置
- 打开里面选项。
- 打开里面
地图工具
,里面的测量工具
修改后就是默认的单位,字段计算器计算几何属性的时候按照这个里面的默认单位计算。
字段数据过滤与增删
从大量数据中对某一字段为特定值的进行过滤,此时可以使用filter进行属性过滤得到想要的数据,类似数据库查询的where语句
- 在非编辑状态,右键选中的图层,选择”过滤”
- 在弹出的”查询构建器”中,点击字段列表中某个,在右侧点击全部,可以获得该字段在图层的所有取值
- 在过滤表达式区域,可以参照SQL的WHERE子句设置过滤表达式,支持精确查找,模糊查找等过滤方式,
参考文献: young_always
ENVI分类后处理
- ENVI,
classification
-Post Classification
-Classification to Vector
, select classified result,Raster To Vector parameters
Outputsingle layer
, andOK
Available Vector List
,File
-Export layer to shapefile...
- QGIS,
CTRL+L
, Open ‘2010.shp’, Add - right click on ‘2010.shp’,
Export
-Save Features As ...
,2010-land.shp
, repeat,2010-water.shp
- 2010-land.shp,
toggle editing
, select water area, then hitdelete
key, save - 2010-water.shp,
toggle editing
, select water area,Edit
-Edit geometry
-delete part
, then click on the area you need to remove, save - 2010-land.shp,
filed calculator
,Expression
, input$area
, calculate feature area, input$perimeter
and calculate feature perimeters - 面积-周长变化趋势表.xlsx
将文本坐标转换为矢量/kml
- 找到工具栏上的“添加文本数据图层”,或者在 菜单“
图层
”->“添加图层
”->“添加文本图层
”,(上图红色位置)点击后弹出下图界面 - 选择保存的点坐标文件,由于文本文件中的坐标是由制表符隔开的,所以分隔符选择制表符,首行也不包括字段名称,所以也不勾选,几何图形定义选择点坐标,进行相应的选择时,下面的列表会实时进行预览,选择点坐标后,会提示选择x坐标和y坐标所在的列。如下图所示,选择完之后点击确定。
- 上图点击确定之后,会弹出选择空间参考的对话框,由于上面的点坐标是经纬度,所以直接在弹出坐标参考选择器重选择
WGS84
即可,一般默认的也就是这个,如果你的点文件坐标是别的坐标系,选择对应的空间参考即可。 - 选择完毕之后确定,即可将数据加载到QGIS视图中。如下图所示,然后再左侧的图层右键,弹出菜单选择另存为,如下图所示:
- 点击另存为,弹出另存为对话框,选择保存的文件路径以及文件格式,最后确定即可,如下图所示:
参考文献:kong
将 DWG 导入 QGIS 项目
项目
-> DWG/DXF 导入