# Project a point onto a profile tool graph in QGIS

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.

• 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

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