Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Basic question, but I have been asked to export data to an XYZ format. Is this the same as CSV files.

I am using QGIS 1.8.0. So i am presuming i select the data I want to export, right click its parent file in the window on the right and save selection as...CSV??

share|improve this question
    
Difficult to say, it could just be Global X-Y-Z coordiantes: ngs.noaa.gov/TOOLS/XYZ/xyz.html –  Andre Joost Jan 4 '13 at 12:04
3  
Wikipedia says its a format for chemical atomic bonds. Kind of larger scale than most GIS' can handle. ;-) - en.wikipedia.org/wiki/XYZ_file_format ----- You need to ask whoever asked for this data to be more specific. –  GIS-Jonathan Jan 4 '13 at 12:08

3 Answers 3

up vote 3 down vote accepted

XYZ is an ASCII gridded data format (see the documentation) for raster data. So, it is very similar to CSV.

However, the tools available in QGIS, don't seem to support exporting to XYZ even though GDAL does (for instance it is not available under either the Save As option and neither through Raster Calculator). However, you can use the gdal_translate command-line utility to translate your raster to XYZ format. Otherwise you have to import your raster to GRASS and then do it there.

share|improve this answer
2  
You can use Raster->Convert->Translate form the Qgis menu, and edit the command line from -of Gtiff to -of XYZ. "Save As" is only working for vector layers. –  Andre Joost Jan 4 '13 at 12:28
    
Cheers for this! –  Gerald Jan 4 '13 at 12:43

i havent try it for creating csv from save as csv but you can use r.out.xyz in grass.The r.out.xyz module exports a raster map as a list of x,y,z values into an ASCII text file.

r.out.xyz - Export a raster map to a text file as x,y,z values based on cell centers.

i hope it helps you...

share|improve this answer

QGIS has a GDAL plugin gdal2xyz that can do it. It is however slow and creates a huge file. Importing it back as ASCII layer in QGIS is even slower and almost freezes the whole computer.

I find r.out.xyz much faster than gdal2xyz and creates files 3 to 4 times smaller.

Loading the files back in GRASS is also much faster Below I imported the files generated by r.out.xyz (458 MB, extension xyz) (loaded in 18 s) the GDAL plugin (1.6 GB, extension csv) (loaded in 1 min 6 s).

It is true, however, that the GDAL plugin has found more points. Visually the imports look the same but the efficiency is dramatically different.

r.in.xyz input=TopoToR_Toro42.xyz.xyz output=TopoToR_XYZ separator=
Reading data ... Writing to map ... r.in.xyz complete. 11398193 points found in region. (Fri Dec 13 16:06:36 2013) Command finished (18 sec)

(Fri Dec 13 16:16:04 2013)
r.in.xyz input=TopoTor_Toro42.xyz.csv output=TopoToR_XYZ_CSV separator=, Reading data ... Writing to map ... r.in.xyz complete. 51619840 points found in region. (Fri Dec 13 16:17:11 2013) Command finished (1 min 6 sec)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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