I have a huge shapefile (roadnetwork of Europe) and a raster file (Europe, 100x100m resolution). I want to calculate the length of the roadnetwork for each raster cell, resulting in a new raster layer. The problem is that the number of raster cells is huge and the roadnetwork is very large.
My current approach in R is to build 60x60 sub-raster (using the SpaDES-package, convert each sub-raster to polygons (using stars and sf) and then intersect the polygons with the road network. The problem is that this takes very long. Parallelizing the process does not work because of memory limitations (st_intersects/st_intersections cause doParallel to make copies of the whole road network for each thread).
Is there a more efficient way to perform the task?
Is there some software with which this taks can be done efficiently?
pixellate.psp– mdsumner Jun 25 '20 at 22:27