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:
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.
In the Processing Toolbox (can be found by going to Processing --> Toolbox), search for
zonal statistics
. Make sure to use the one located within theRaster analysis
parent.Your
Input layer
will be your grid (shapefile)Your
Raster layer
is the file you shared (cassava_harvestedAreaHectares.tif)Leave
Raster band
as 1Output 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"Click on the three dots from
Statistics to calculate
to select the stats you want to compute (see image 2)Click on the three dots from
Zonal Statistics
and choosesave to File...
Make sure the
Open output file after running algorithm
is checkedRun
You will receive a new grid. Right click and open the attribute table.