If I have an existing row in my PostGIS database with NULL geometry, is it possible to select a feature from another layer in QGIS, and paste that into the empty geometry column for the PostGIS row?


1 Answer 1

  • Import the Shapefile that contains the feature into PostGIS (keeping them in the same SRIDs), you can use shp1pgsql or pgShapeLoader
  • Select the geometry of the feature (Apply a filter, button in the top panel near the SQL query button, select the feature you want to copy the geometry of)
    enter image description here
  • Double click the geometry, copy it and then paste it in the NULL geometry column. enter image description here
  • I'm not sure I follow. Where am I doing the copying and pasting? Within QGIS? I don't see geometry columns in QGIS. I can see them in the DB Manager, but cannot copy/paste. Maybe I could ask the question in a more general way: what is the best way to move a single feature from a shapefile to a PostgreS table -- especially in a case where the table schema of the shapefile doesn't exactly match that of the PostgreS table? Commented Feb 15, 2016 at 3:58
  • You'll copy and paste them in PostGIS, you'll have to move the shapefile to PostGIS first Commented Feb 15, 2016 at 4:34

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.