I am importing waypoints from GPS (in gpx format) using Layer>Add Vector layer and then I want to clean up the data and add some more attributes and finally add them to a master table in PostGIS.

The import works fine but I get a table with a lot of fields I don't need and the fields I do need in some cases have the wrong names nor can I modify the table without doing a save as and reloading it.

So I end up

  1. importing the layer,
  2. saving it as a in a format that I can modify
  3. importing it again
  4. clean up the data and add new attributes (using some of the fields i don't need)

Now I want to update the master table. The only way I can see of doing this is to save the layer as PostGIS (or do this in step 2) and then use SQL to do the update so I can select which fields I want inserted in which columns.

Is there a more stream lined way of doing this?

PS. I am guessing the answer is write a script to do it. To this end I have just purchased The PostGIS cookbook and the Pyqgis book but it will be a few weeks while they travel around the world.


For step 2, I use shapefile format, and step 3 is just a checkbox in the Save As... dialogue.

To delete old and create the new columns, I use the Table Manager plugin, or the field calculator if all get the same value like date.

Then I zoom to the temp layer extent, select all features of the temp layer by rectangle, make the master layer (Postgis or spatialite) editable, and insert the features there.

This is straight forward, and might be automated by a script if you want and can.

| improve this answer | |
  • Thanks (again ;) Andre! I had missed the checkbox in the "Save As" dialogue and I had not though of cutting and pasting the resulting features into the master layer. – Russell Fulton May 18 '14 at 6:24
  • hmmm... table manager has the 10 char name length restriction even for spatialite files. I hate 'descripto' ;) I really am going to have to come to grips with writing and patching plugins! – Russell Fulton May 18 '14 at 7:10

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.