GeoTIFF – How to Obtain Information from TIFF and XML Files

geotiff-tiffimportxml

I am downloading data of http://www.earthstat.org/harvested-area-yield-175-crops/#ind-crops, which gives me the harvest area of different crops around all the world.

Once I downloaded the data for one crop, I have two files, one IrfanView TIFF File and one XML file. To import the IrfanView TIFF File to QGIS I do "Layer", "Add Layer" and "Add Raster Layer". I obtain a map scaling by colors. I try to get the data from the Attribute Table but there is no attribute table, so I am not sure how I should procedure to get/obtain the data to use it.

On the other hand, to import the XML file, I downloaded the Plugging LandXML and when I import the file it says

Python error : An error has occurred while executing Python code: See message log (Python Error) for more details.

I am new in QGIS.so How can I obtain the information of the files to use (maybe transforming the tif file in a shp file? I have just searched online how to import them. Should I mix both files? Are they complementaries? Am I importing them wrong?

According to the web page, the dataset contains a map of spatial resolution five minute by five minute, 4320×2160 cell grid, the spatial reference is GCS_WGS_1984, the cell size is 0.083333 degrees, etc. And one of the main data is the average fractional proportion of a gridcell that was harvested in a crop during the 1997-2003 era. However, I am not able to get the data with that two files.

I attach a image of the type of files I have:

enter image description here

Best Answer

In regards to @CholeG comment, yes, you will want to perform zonal statistics if you have a shapefile grid and are looking for stats within each of your grids.

  1. In the Processing Toolbox (can be found by going to Processing --> Toolbox), search for zonal statistics. Make sure to use the one located within the Raster analysis parent.

  2. Your Input layer will be your grid (shapefile)

  3. Your Raster layer is the file you shared (cassava_harvestedAreaHectares.tif)

  4. Leave Raster band as 1

  5. Output column prefix is the prefix of what will show in your attirbute tabel column title. For example if you were to calculate the sum for each grid and your prefix was "cassava_", your column title would be "cassava_sum"

  6. Click on the three dots from Statistics to calculate to select the stats you want to compute (see image 2)

  7. Click on the three dots from Zonal Statistics and choose save to File...

  8. Make sure the Open output file after running algorithm is checked

  9. Run

You will receive a new grid. Right click and open the attribute table.

enter image description here

enter image description here

Related Question