I'm trying to get data from a polyline layer into a grid (I've created this with regular points, points to polylines). I guess at first I have to cut all polyline segments at the grid lines and then I have to spatially join (which only works for the first feature found) all of them into each grid cell. I want to find out road network length differences in different areas.
Create a polygon grid using the
Vector Grid tool instead of lines. Make sure to check the polygon output.
Once you have a polygon grid (also known as fishnet), you can use the
Sum line length tool in the QGIS Vector analysis tools. This will result in a new field for each cell with the total road length inside it
Here's a simple example of a vector polygon grid with overlayed line layer.
And after the sum lines in polygons tool, with symbology based on the summed length field.