[GIS] Exporting climatic tabular data stored in TIF file into CSV

climatecsvexportgeotiff-tiff

I have a TIF file containing tabular climatic data, described here, which I am trying to export to spreadsheet / CSV format:
http://www.helioclim.org/linke/linke_helioserve.html

In summary, it is a TIF with no header, 2160 rows by 4320 columns, where the upper left corner is 90 N, 180 W, and the lower right corner is 90S 180 E. Standard stuff. I also know that the output data is supposed to be an integer roughly between 40 and 140.

All I want to do is to extract the tabular data into a spreadsheet as source data for calculation purposes (I'm well aware that the column count exceeds Excel's capabilities). It seems the TIF is used as a very efficient container of the GIS raw data. And since the TIF contains data that is already in tabular format, I thought it would be relatively easy (not the case).

So far the only thing that has 'kinda' worked I have tried freeware "Grid Convert" to CSV, but it produces 3 columns of output data, the first 2 being all zeros and the third, 7 digits long, presumably 9,331,200 rows. It's still useless, but nothing else has worked. I don't have much experience working with this kind of data format, a starting heads up would be welcome 🙂

In case it might help, this is a download link to part of the raw data, under "Linke Turbidity Factor: Monthly maps"
http://www.soda-is.com/eng/services/climat_free_eng.php

Anybody have any ideas how I may extract the raw data from the TIF file?

Thanks in advance

Best Answer

A very simple approach which springs to mind is to export the tiff to an ascii grid format such as ESRI's .asc file. You will then have a space delimited plain text file. It will have a few header lines which describe the origin, resolution and NoData values etc and you can easily skip over these for the sake of you calculations. You can do the translation using GDAL_translate or QGIS if you are looking for free tools or obviously use ArcGIS if you have it.

Alternatively, instead of changing the storage format, why not change your approach to performing the calculations? There are various APIs and tools available that will allow you to do all manner of calculations on an array (which is all the Tiff is after all). For example you gould use the GDAL Python Api in conjunction with NumPy and/or SciPy. The latter two modules give you great array handling capabilities. In that way you could analyse the Tiff as-is.

Related Question