2

I am looking to replicate a tool that is available in Geospatial Modelling Environment (GME) within QGIS, preferably not using GRASS. The tool is isectlinerst (Intersect Lines With Raster) http://www.spatialecology.com/gme/isectlinerst.htm

I am hoping to have a tool that can extract raster information (i.e. slope) for an entire linear network (i.e. roads). I have seen other post on here that show a rasterize process, but I am looking to maintain the vector input data and add the attributes to the data.

1
  • In principal, I think that many of the statistics you'd like to calculate, like mean, minimum/maximum can be generated for line layers in QGIS using Zonal Statistics (unless that tool runs an undesired rasterize in the background?). You could then easily divide the mean by the length of a given line to get the 'length weighted mean', and the only remaining one to calculate is the start/end cell values, which can also probably be calculated with PyQGIS. I personally have ran into issues with calculating zonal statistics for short line segments, but you may have a better experience with it.
    – 15Step
    Commented Mar 28, 2018 at 20:46

1 Answer 1

3

SAGA Profiles from lines may satisfy your needs, though it does not directly return slope or other information. It returns rather raw data of cells intersected by your line layer.

When you give the raster (DEM) and linestrings (roads), it will return a Profiles (points) along the line.

Each point represents the cell center of the raster along the line. The attribute table is populated with information from your raster:

  • LINE_ID: your road id
  • ID: point id starting from the start point of each road (in my example: Path layer)
  • DIST: distance from start point
  • DIST_SURF: distance from start point, along the DEM (so it is slightly longer than DIST.
  • X,Y,Z coordinates

You will need to calculate slope and/or other statistics, but I think you would be more confident about the result.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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