3

I'm using the Profile Tool add-on in QGIS to extract a profile of a raster data layer.

Along this profile there are a series of points which I'd like to project onto the Profile Tool graph so that I can see them in the graph.

Is this possible? I'm happy to use another add-on to achieve the same results if there's something that works better.

GIS Profile

  • If the x-axis of the graph is distance along the line, you could find the x-coordinate of each point on the graph by measuring each point's distance from the start of the line. – csk Aug 16 '18 at 22:03
  • True, but I have WAAAAAAY more points that just this. I'm ideally looking for a way to put them on there automatically. – hojkoff Aug 17 '18 at 6:40
1

According to Anita Graser's Profile Tool tutorial, you can

open the “Table” tab of the Profile Tool panel which provides access to the profile data and copy the data into your preferred graphing application such as Calc or Excel.

So we can put the profile tool data into a spreadsheet with the point data, and use the chart builder in Excel (or another graphing application) to create the desired chart. In order to plot them in the same graph, we need to calculate the x-axis location for each point.

According to Spatial Galaxy's QGIS Plugin of the Week: Profile

The X axis shows the distance along the profile line in map units

So we need to calculate the distance of each point from the start of the profile line in map units.

Use the Grass tool v.distance from the Processing Toolbox.

  • This tool requires that the layer have an existing column to put the distance value into. Add a column called "to_along" to the point layer.
  • This tool calculates distance in map units, which are determined by CRS. Make sure your map CRS is the same as the profile line layer CRS.

Use these settings for the v.distance tool:

  • 'from' vector map: your points layer
  • 'to' vector map: your line layer
  • 'upload': to_along
  • Column names where values specified by 'upload' option will be uploaded: "to_along"

The output is a point layer called Nearest and a line layer called Distance. Ignore the line layer.

The column "to_along" in the new point layer should have the distance of each point from the start of the line, measured along the line. Use the measure line tool to confirm this.

Copy the attribute table into your preferred graphing application, along with the table from the Profile Tool. Use the graphing application to plot the profile line and points.

Instructions for creating a chart in Microsoft Excel can be found here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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