1

I'm trying to calculate 10x10 km pixels from a 30x30 second raster in QGIS. The raster calculator seems to do what I want, except that the new raster has nodata in cells where more than half (I guess?) of the area from the source raster is nodata. Is there a way to make the calculator ignore nodata or change the acceptable nodata threshold? I've also read Projections->Warp suggested, but I'm not sure how this would work with the second to km conversion.

Note: I'm aware that ignoring large amounts of nodata has severe pitfalls, but I think it should be OK in this case, as nodata simply means 'water', and I'm only interested in what's on the land, but would like to retain coastal cells that are only 10% land.

EDIT: Apologies for not checking this in detail before posting, but after experimenting with different resolutions it seems that there is no real 'threshold' as I assumed. At 5x5 km I have some cells as nodata even though their area is 80%+ covered by the source layer, others have a value even though only ~10-20% of their area is covered. All cells where the area is 100% or 0% covered behave as expected, while those on the edge (i.e. partially covered in the source layer) may or may not have a value in the output layer. I can't really seem to find a pattern. Any advice?

1

After some experimenting I think I found a workaround to my problem. I first used the raster calculator to calculate a high resolution UTM raster from the degree raster, then used gdalwarp on this, with resampling set to average, to calculate a low resolution UTM raster file. The results look good.

If this is a bad idea or unnecessarily complicated please let me know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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