[GIS] How to transform XYZ raster from WGS84 to UTM ED50 Zone 34

coordinate systemqgisxyz

I'm trying to convert an XYZ file from WGS84 (lat/long) to UTM ED50 zone 34. QGIS can load the file as a raster, but I can't see a way of changing the coordinate system or exporting the results as an XYZ file.

Is this possible in QGIS?

Best Answer

Assuming you have an ASCII XYZ file with SRTM-like data loaded to the canvas:

  • go to Raster -> Projections -> Warp (Reproject)
  • select your input file (if not alredy selected)

Unfortunately, gdalwarp can not write XYZ raster files, so we use a vrt file for intermediate saving

  • select an output file test.vrt (format .vrt)
  • Set Source SRS to EPSG:4326
  • check target SRS and select EPSG:23034 for for ED50 34N

The command line in the last box should be something like

gdalwarp -overwrite -s_srs EPSG:4326 -t_srs EPSG:23034 -of VRT D:/Karten/Geotiff/N50E019.xyz D:/Karten/Geotiff/test.vrt

Just hit Ok and the file should be created and added as new layer.

No we translate the vrt to XYZ in a second step:

  • Raster -> Conversion -> Translate
  • select the vrt layer for input
  • for output, choose File format ASCII gridded XYZ and a new name:

gdal_translate -of XYZ D:/Karten/Geotiff/test.vrt D:/Karten/Geotiff/out.xyz

Related Question