I want to create a raster with a 25 metre × 25 metre resolution, where each cell contains the distance to the nearest coastline, as calculated from the center of the cell. To do this, all I have is a shapefile of the coastlines of New Zealand.
I have tried following Dominic Roye's tutorial for doing it in R which works... kind of. It is fine down to about a 1 km × 1 km resolution but if I try to go any higher the RAM it requires well exceeds that available on my PC (~ 70 gb of RAM required) or any other that I have access too. In saying that, I think this is a limitation of R and I suspect that QGIS might have a more computationally efficient way of creating this raster, but I am new to it and I can't quite figure out how to do it.
I have tried following Creating raster with distance to feature using QGIS? to create it in QGIS but it returns this error:
_core.QgsProcessingException: Could not load source layer for INPUT: C:/..../Coastline/nz-coastlines-and-islands-polygons-topo-150k.shp not found
and I am not sure why.
Does anyone have any suggestions of what might be going wrong or an alternative way of doing this?
Edit:
The raster I am hoping to produce would have about 59684 rows and 40827 columns so that it overlaps with the annual water deficit raster from LINZ. If the raster that is produced is larger than the annual water deficit raster I can snip it in R though...
One thing that I think might be a potential issue is that the shapefile of NZ's coastline has a large amount of sea between the islands, and I am not interested in calculating the distance to coast for these cells. I really only want to calculate the values for cells that are include some slice of land. I am not sure how to do this, or if it is an actually problem though.