[GIS] Convert relative coordinates into absolute ones having only one absolute coordinate in QGIS

convertcoordinate systemdgpsqgis-3wgs84

I have a layer of points with relative altimetric heights from a survey carried out with a Differential GPS. I know the absolute coordinates of only one point (EPSG:4326 WGS 84 ), the other points have coordinates in an arbitrary system.
this is the excel file in which is registered the absolute coordinate of point1
this is the arbitrary coordinate system in which are the points
Is it possible to transform all other relative coordinates into absolute ones based on a single point known with QGIS?

Best Answer

The question was missing a little bit of info but with the dataset in hand, I was able to roughly find out what was going on.

First off, each point is actually composed of 6 different points that each contain a single attribute that belongs to the actual point, which is the one in the middle:

enter image description here

You need to isolate the true point with the tool Extract by attribute from the Processing Toolbox:

  • Input layer: original layer
  • Selection attribute: Layer
  • Operator: =
  • Value: 0

The resulting layer can be renamed Points. This tool can be repeated twice, with Value: ID_punto and Quota. The resulting layers can be renamed to match the values.

Next, use the Join attributes by nearest tool:

  • Input layer: Points
  • Input layer 2: Quota
  • Layer 2 fields to copy: Text
  • Joined field prefix: Quota_
  • Maximum nearest neighbots: 1

Do this one more time, but in the input layer, use the resulting layer from the previous join attributes so that all the text fields from the surrounding 2 points are added to the true point. Rename the resulting layer to something like Cleaned points.

This cleaned points layer will have many useless fields, so these can be deleted to only keep the 2 important ones like so:

enter image description here

The next step is to create two fields containing the X and Y coordinates, relative to your point with known real world coordinates. In the attribute table, go to the Field Calculator:

  • Create a new field
  • Output field name: Rel_X
  • Output field type: Decimal
  • Output field length: 0
  • Expression: round($x - x(geometry( get_feature( 'Cleaned points','ID_Text','1'))),4)

The result is the rounded (to 4 decimals) distance to the main point in map units along the X axis. Repeat this step to create a field called Rel_Y, replacing all the x mentions to y. The table should look something like this:

enter image description here

From here on I'm relying on a certain assumption; that the north of the survey was aligned with geographical north and also that the survey units were meters.

We know the geographic coordinates of the point with ID: 1, which is:

  • 39°42'36.35"N 64°23'5.76"E

Using epsg.io, transform this to UTM Zone 41N (epsg:32641):

  • X: 618718.05
  • Y: 4396498.45

Create two fields, X and Y, in the attribute table (Decimal). For the point with ID 1, paste the corresponding values. Now we can use the field calculator again to find every point's true coordinate in EPSG:32641:

  • Update existing field
  • Choose field X
  • Expression: round(attribute(get_feature('Cleaned points','ID_Text','1'),'X') + attribute('Rel_X'),4)

Repeat for the field Y, and now you have a relatively precise location for each of your points. You can now export this layer as a CSV table.

Import that table as a CSV source. In geometry definition:

  • point coordinates X field: X column
  • point coordinates Y field: Y column
  • Geometry CRS: EPSG:32641

The added layer is now positioned correcly on Earth (following the assumptions I made). If you want to use it in applications where only geographical coordinates are supported like Google Earth or on Mapbox, for example, export this layer using WGS84 as the output CRS. The result looks like this:

enter image description here

If my assumptions were wrong and the survey's axes were not aligned with geographical north, additional trig steps would be required to get correct coordinates.