1

For an archaeological project, I collected a huge amount of points coordinates in a PostGIS table using a GPS (3-5m accuracy). All points have a unique name.

After that I recorded all the points using a differential GPS.

What I want is to update the coordinates of all the GPS points in my PostGIS table with my dpgs precise coordinates (centimetric accuracy).

In both tables, the points have the same name so I'm looking for a way to batch move all the PostGIS points in QGIS using the DGPS coordinates I have in a CSV file.

3
  • Add whatever code attempt you have or the question will probably get closed
    – BERA
    Jan 31, 2023 at 14:44
  • Can you load the dgps coordinates in Postgis? If yes it is a straightforward join+update
    – JGH
    Jan 31, 2023 at 14:56
  • This would mean join and update the "geom" column?
    – tonyduky
    Jan 31, 2023 at 17:37

1 Answer 1

2

Update the geometry of the gps table - make a backup first in case something goes wrong:

update gps_table a set geom = b.geom from dgps_table b where a.name = b.name;

OR

update gps_table a set x_coord = b.x_coord, y_coord = b.y_coord from dgps_table b where a.name = b.name;

OR

update gps_table a set geom = st_setsrid(st_makepoint(b.x_coord,b.y_coord),<srid>), x_coord = b.x_coord, y_coord = b.y_coord from dgps_table b where a.name = b.name;

etc.

1
  • Used the first one! Just had to make sure both geometries were the same.
    – tonyduky
    Feb 7, 2023 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.