我想将栅格转换为QGIS中的Point Vector。可能吗?QGIS有将其转换为多边形的选项,但我没有找到任何将其转换为点的工具。谁能帮我?
我想将栅格转换为QGIS中的Point Vector。可能吗?QGIS有将其转换为多边形的选项,但我没有找到任何将其转换为点的工具。谁能帮我?
Answers:
保存为ASCII网格并导入为定界文本可能会满足您的要求。
请参阅本教程:
http://www.slideshare.net/shencoop/qgis-raster-to-point
如果您想要一个密度较小的点文件,请尝试以下教程:
GRASS-GIS-tool r.to.vect可以做到。选择点作为输出。您必须为此安装GRASS-GIS。
point
。
QGIS 3.4
QGIS 3.4(2018年10月)中新增了一个栅格像素指向工具。
该工具的运行速度惊人。当我将11兆字节的单波段栅格转换为点层(最终得到600万个点)时,处理时间为:
栅格像素到点 .................................... 10.35秒
处理-SAGA栅格值到点 ..... | 380秒
SAGA GUI-点的网格值 .................................... | 130秒
(此刻我无法运行)GRASS r.to.vect ……| 不定时。
(这可能是不公平的比较,因为SAGA工具会返回x和y坐标以及栅格值)。
REM English
REM Tested in QGIS console version 2.18 (OSGEO4W Shell)
REM Tested in Windows Operating System
REM Folder where the image is (replace with your file directory): C: / Users / Administrator / Documents / ruts /
REM Name of the dsm file: dtm_phase1_vm_15m_inside.tif
REM Name of the output file csv: dtm_phase1_vm_15m_inside.csv
REM Name of output file shp: dtm_phase1_vm_15m_inside.shp
REM eye that some directions (path) has separator / (bar) and other \ (backslash), respect them so you do not have problems
REM spanish
REM Probado en consola de QGIS version 2.18 (OSGEO4W Shell)
REM Probado en Sistema Operativo Windows
REM Carpeta donde estan la imagen (sustituya por su directorio de archivos): C:/Users/Administrator/Documents/surcos/
REM Nombre del archivo dsm: dtm_phase1_vm_15m_inside.tif
REM Nombre del archivo de salida csv: dtm_phase1_vm_15m_inside.csv
REM Nombre del archivo de salida shp: dtm_phase1_vm_15m_inside.shp
REM ojo que algunas direcciones (path) tiene separador / (slash) y otras \ (backslash), respetelos para que no tenga problemas
REM converts the dsm image (surface model) from TIF format to CSV format
REM convierte la imagen dsm (modelo de superficie) de formato TIF a formato CSV
gdal2xyz.bat -band 1 -csv C:\ Users \ Administrator \ Documents \ surcos \ dtm_phase1_vm_15m_inside.tif C:/Users/Administrator/Documents/surcos/dtm_phase1_vm_15m_inside.csv
REM removes the null values from the csv file (Z = 0)
REM elimina los valores nulos del archivo csv (Z = 0)
sed -i'/,0 \ s * $ / d'C:/用户/管理员/文档/surcos/dtm_phase1_vm_15m_inside.csv
REM adds header to file with column names x, y, z
REM agrega encabezado al archivo con nombres de columna x,y,z
sed -i'1 i \ x,y,z'C:/用户/管理员/文档/surcos/dtm_phase1_vm_15m_inside.csv
REM converts the csv file to shp format
REM covierte el archivo csv a formato shp
ogr2ogr -s_srs EPSG:32749 -t_srs EPSG:32749-方言SQLite -sql“ SELECT CAST(z AS float)as z,MakePoint(CAST(x AS float),CAST(y AS float))FROM dtm_phase1_vm_15m_inside” C:/用户/Administrator/Documents/surcos/dtm_phase1_vm_15m_inside.shp C:/Users/Administrator/Documents/surcos/dtm_phase1_vm_15m_inside.csv