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. Is it possible to transform all other relative coordinates into absolute ones based on a single point known with QGIS?
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:
You need to isolate the true point with the tool Extract by attribute from the Processing Toolbox:
- Input layer:
- Selection attribute:
The resulting layer can be renamed Points. This tool can be repeated twice, with Value:
Quota. The resulting layers can be renamed to match the values.
Next, use the Join attributes by nearest tool:
- Input layer:
- Input layer 2:
- Layer 2 fields to copy:
- Joined field prefix:
- Maximum nearest neighbots:
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:
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:
- Output field type:
- Output field length:
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:
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):
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
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:
- point coordinates Y field:
- Geometry CRS:
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:
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.