I wanted to use the QGIS function 'Sum Line Length' to compute the sum of the road lengths in each grid cell in Nigeria. My roads data is from here: https://data.humdata.org/dataset/nigeria-roads My grid net is the PRIO Grid, hence 0.5 x 0.5 degree grid cells.
When I first used the function mentioned above all the data was in the "standard" geographical CRS EPSG:4326 - WGS 84. So the units were degrees. But since I need meters for better interpretation in my (spatial) regression, I exported the data to a projected CBS (EPSG:3786 - World Equidistant Cylindrical (Sphere)) and reran the function. Before when everything was in degrees, the column 'length' had actual values/numbers. But when I did it in the other CRS every cell which should have had values, has 'nan'.
I already tried different road data and different CRSs, nothing helped.
Although a similar question has been asked (QGIS "Sum Line Lengths" return 'nan.'), I don't see the solution.
(using QGIS 3.12.2)