I have a grib file containing temperature and precipitation, monthly, from 1989 to 2019 for a specific region (extracted from ERA5-Land).

I imported it in QGIS as a mesh layer.

I need to locate those data on a grid I already made (to add the id of my grid cells to each value of the mesh, and then aggregate temperature and precipitation at the grid scale).

I have never used time series spatial data, so my approach could be wrong.

First, I used the mesh function "export time series values from points of a mesh dataset", and as "points for data export" I put my grid shapefile. The CSV file I got had the right time period, but each value was NaN, the identifier was 0 for each observation, and both x and y coordinates were 0.

So I tried using the function "export mesh on grid", but I got temperature and precipitation averaged over the whole period while I would like to keep each observation in time.

What is the best way to do this?

Edit : is there a way while using "export mesh on grid", to create one variable for each time-period/variable combination ?

1 Answer 1


For anyone having the same issue, I divided the problem.

First, I used Python to get a traditional dataframe. More details here : https://stackoverflow.com/questions/67963199/xarray-from-grib-file-to-dataset/67995661#67995661

From here, I just kept one observations for each location. Then, I imported this file back to qgis as data point and was able to do the intersection with my grid.

Then, in another statistical software I just merge those IDs obtained with the intersection with the rest of the data containing the variables for each year.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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