I am trying to quantify the length of a road network, on each cell of a lattice grid. Both my road network and my lattice grid are shapefiles, a polyline and a polygon respectively.
I would like to process them on the "sf" package in R, however I found no command for computing the total length of the road network in each cell of the grid. Do you have any idea on how this could be implemented?
Best,
Jacopo Cerri
From the limited information required, it sounds like you need to perform an intersection of the lines (road network) with the grid, and calculate the length of said intersection(s) per cell: