3

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).

1

1 Answer 1

9

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).

gdal


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

xyz

4
  • is this good to plot a map with GMT? Nov 15, 2016 at 21:54
  • I've never use GMT, only QGIS for cartography. Which kind of input do you need for GMT?
    – aldo_tapia
    Nov 16, 2016 at 0:52
  • I also never use GMT, I use Arcgis and QGIS for cartography but someone request me x,y,z to plot a map with GMT. He told me that .txt and.prj it´s ok for him but I don´t know if .csv can run Nov 16, 2016 at 14:42
  • I edit my answer, take a look.
    – aldo_tapia
    Nov 16, 2016 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.