I have a list of points showing the locations of some planned site investigations. Due to practical issues some of the locations were changed during the field work. The new locations was surveyed with a GPS. I've managed to merge the two files by point-name.

What I'm trying to do is to create a mark (point) showing the planned position and a line between the planned and actual position of the investigation to show the "offset".

Tried this with the geometry generator:

make_line(centroid($geometry),make_point( "183000 LETBANE_BOR_DKTM3_Easting" , "183000 LETBANE_BOR_DKTM3_Northing" ))

Seems like the "centroid.."-part is working, but the "make_point.." from coordinates is giving the wrong result:

Tried with geometry generator

| improve this question | | | | |
  • I assume you are working with QGIS, isn't it? – ahmadhanb Nov 26 '18 at 6:37
  • 1
    What GIS software are you using? – PolyGeo Nov 26 '18 at 6:37
  • QGIS it is, sorry :) – Martin Thyme Nov 26 '18 at 11:02

Since the make_point() function is putting the points in the wrong location, I suspect a CRS issue.

Probably QGIS is interpreting the "183000 LETBANE_BOR_DKTM3_Easting" and "183000 LETBANE_BOR_DKTM3_Northing" coordinates as though they're in a different CRS. Since they're so far away, it's probably assuming the coordinates are in decimal degrees when they're actually in meters.

Check if the coordinates are in the same CRS as the project and the actual points layer. If not, you have two options.

  1. The simplest option is to re-project the layer into the same CRS as the easting and northing coordinates.

  2. Another option is to use the transform() function to project the point into the correct CRS, like this:

    make_line(centroid($geometry),transform( make_point("183000 LETBANE_BOR_DKTM3_Easting","183000 LETBANE_BOR_DKTM3_Northing"), 'EPSG:aaaa', 'EPSG:bbbb' ))

EPSG:aaaa is the CRS ID that the coordinates are in, and EPSG:bbbb is the CRS ID for the current layer.

| improve this answer | | | | |
  • Thank you!! The problem was the CRS - the "DKTM3_Easting" and "Northing" was in the same CRS as the project, but the origin of the points was a KML in another CRS. Re-project solved the problem :D – Martin Thyme Nov 27 '18 at 13:12

I assume you are using QGIS, the expression to create the lines is correct, but you need to add another Geometry Generator symbology for the end point location something like the following:

make_point( "X_1" , "Y_1" )

Where "X_1" and "Y_1" are the x and y coordinates for the new locations as you can see in the image below (purple color)

enter image description here

For the line geometry generator, it is same as the one you have:

make_line(centroid($geometry),make_point( "X_1" , "Y_1" ))

enter image description here

Here is the output:

enter image description here

The red points are the original locations and the purple points are the new locations.

| improve this answer | | | | |
  • Thanks for your answer. The "183000_...Easting" and "..Northing" is the (x,y) for the end points. – Martin Thyme Nov 26 '18 at 11:04
  • @MartinThyme Yes I noticed that, but it is not a good practice to start field names with digits (numbers) and try to shorten the field name. What you need to do is add another point using geometry generator with the coordinates of the planned points or new location. – ahmadhanb Nov 26 '18 at 12:48

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.