2

I am fairly new to GIS.

I have a line of a survey track that is approx. 380km long. I can correctly measure this using $length, and with the measure tool. I am using a custom transverse mercator custom CRS of my survey area.

When I try to place regular points along the line, using Points along geometry or QChainage, the algorithms seem to think my line is only a few metres long. If I space points every 'one metre', I will get 5 points, but if I try to space points every km, I will only get one point at the start of the line.

How can I get points every km?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Hayley
  • 23
  • 3
  • I guess that your survey line is measured in longitude-latitude degrees and the function is placing points by using degree as a unit. – user30184 Feb 15 '20 at 15:46
  • I think that's likely, but I have set everything to metres everywhere I can think of, and can get measurements in m. Any idea how to address this? – Hayley Feb 15 '20 at 15:53
  • length($geometry) expression returns meters or degrees? – Gabriel De Luca Feb 15 '20 at 16:40
  • You can confirm @user30184 by projecting your track to a known CRS that utilizes meters or feet. Then apply Qchainage to the new layer and examine the results. If the results are what you want, then the problem lies in your custom CRS. "Theory guides, experiment decides" - Izaak Kolthoff – Stu Smith Feb 15 '20 at 16:41
  • Thanks all - I changed the projection to WGS 84 / UTM zone 30N EPSG:32630 and still had the same problem, BUT length($geometry) returned the answer in degrees. Any thoughts as to what I should do? – Hayley Feb 15 '20 at 17:04
  • Did you reproject the layer, or did you only change the projection in the layer settings? – csk Feb 15 '20 at 17:16
  • I have now gone back and recreated the line in a new project from the original GPS data in WGS 84 / UTM zone 30N EPSG:32630 and am still having the same problem! At my wits end... I know it's going to be so obvious when I get it but I just can't. The line was created from GPS points in CSV file using Points to Paths... could that cause any problems? I had the same problem creating the line using Points to One. – Hayley Feb 15 '20 at 18:18

1 Answers1

4

Since length($geometry) returns degrees, the coordinates that defines the geometry are in degrees, so the layer must have a Geographic CRS.

You need to reproject the layer. The easiest way to do this is to export the layer to a new one, with your custom projected CRS. See: Reprojecting Vector Layer in QGIS, the question is old but still valid.

Gabriel De Luca
  • 14,289
  • 3
  • 20
  • 51
  • Thanks for your patience with me! The thing is I have reprojected the layer several times now and it hasn't solved the problem. I've even reprojected the point layer and remade the line from the reprojected points, and it made no difference. I guess I'll go read the docs thoroughly and see if I can find a solution! – Hayley Feb 16 '20 at 11:14
  • Maybe because you have imported the points in a projected CRS, but they are in a geographic one. From scratch, start a new project, add an OSM basemap to it, import the points in WGS84 geographic CRS. The points must be placed in their correct geographic location. Reproject the points layer to a projected CRS. The points must remain placed in their correct geographic location. Process the projected CRS layer. – Gabriel De Luca Feb 16 '20 at 13:14
  • It worked! Thank you so much! – Hayley Feb 16 '20 at 15:17
  • Sometimes it is not trivial to find which part of the process is the one with the fault. I'm glad we found it. You are welcome! – Gabriel De Luca Feb 16 '20 at 16:11