How can I convert a .tif DEM to XYZ format using QGIS?
What I have is a geotiff image. What I need to do is turn that .tif into folders containing several XYZ tiles (like how Google Maps or OpenStreetMaps serves their tiles).
How can I convert a .tif DEM to XYZ format using QGIS?
What I have is a geotiff image. What I need to do is turn that .tif into folders containing several XYZ tiles (like how Google Maps or OpenStreetMaps serves their tiles).
In QGIS, go to Processing toolbox
/ GDAL/OGR
/ [GDAL] Conversion
/ gdal2xyz
This tool will extract x, y and z to a comma separate values file (.csv).
EDIT:
1) results is a .csv file. If you want to convert it to .txt, just open file.csv in excel an click en save as... / Text - tab delimited .(txt)
2) to export to a .xyz file.
n QGIS, go to Processing toolbox
/ GDAL/OGR
/ [GDAL] Conversion
/ Translate (convert format)
Go to Save to file...
and select XYZ files (*.xyz)
In your case, from GMT documentation:
Examples
To create a grid file from the ASCII data in hawaii_grv.xyz, use
gmt xyz2grd hawaii_grv.xyz -Ddegree/degree/mGal/1/0//”Hawaiian Gravity”/”GRS-80 Ellipsoid used” -Ghawaii_grv_new.nc -R198/208/18/25 -I5m -V