QGIS导入json、txt、csv数据并导出为shp
json
适用于现代 C++ 的 JSON。
项目地址:https://gitcode.com/gh_mirrors/js/json

·
QGIS导入json、txt、csv数据并导出为shp
0 问题描述
- 有一组测站位置数据,只有展点名称和经纬度坐标,想在GIS软件中展示出来,并导出为shp数据。
- 数据格式为
json
、txt
、csv
、xlsx
等文本格式,文中所说的josn不是GeoJson
1 格式转换
其实不管是什么格式的表格文本数据,想转成shp
格式的矢量数据,应该先转成csv
格式或者txt
的表格文本数据。
当然,QGIS也支持dat
和wkt
格式的文本文件
1.1 JOSN
转csv
或者txt
网站JSON转CSV - 在线转换文档文件可以在线将json
文件转换成csv
文件,操作便捷,转txt
也是一样的方法,不再赘述
- 点击
选择文件
,选择目标格式
,再点击开始转换
,最后点击下载
即可
1.2 txt
和xlsx
转csv
暴力改后缀为csv或者在Excel里面导出为csv即可
2 在QGIS中可视化并另存为shp
2.1 在QGIS中加载csv文件
- 点击菜单栏的
图层---添加图层----添加分隔文本图层
- 需要注意的是,文本文件的第一行应该是说明性数据,比如ID,x,y,z等数据
- 选择好csv文件之后,在几何图形定义中点击点坐标,定义xy字段的第一行标题,选择坐标,最后点击添加,然后关闭这个窗口即可看到数据已经添加好了
2.2 在QGIS中加载txt文件
步骤和上一节基本相同,只是在几何图形定义中选择分隔符为正则表达式,表达式为空格
(在txt中可以看到分隔符,表达式就是分隔符),其他步骤一样,不再赘述
2.3 将图层导出为shp
这一步很简单,直接右键另存为即可,导出时候注意别看错格式,选择ESRI Shapefile
,点击OK即可导出成功。
不管是csv可视化
成果还是txt可视化
成果,都可以这样操作




适用于现代 C++ 的 JSON。
最近提交(Master分支:4 个月前 )
f06604fc
* :page_facing_up: bump the copyright years
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
* :page_facing_up: bump the copyright years
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
* :page_facing_up: bump the copyright years
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>
---------
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com> 1 个月前
d23291ba
* add a ci step for Json_Diagnostic_Positions
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* Update ci.cmake to address review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* address review comment
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix typo in the comment
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix typos in ci.cmake
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* invoke the new ci step from ubuntu.yml
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* issue4561 - use diagnostic positions for exceptions
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci_test_documentation check
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* address review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci check failures for unit-diagnostic-postions.cpp
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* improvements based on review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix const correctness string
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* further refinements based on reviews
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* add one more test case for full coverage
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* ci check fix - add const
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* add unit tests for json_diagnostic_postions only
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci_test_diagnostics
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci_test_build_documentation check
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---------
Signed-off-by: Harinath Nampally <harinath922@gmail.com> 1 个月前
更多推荐
所有评论(0)