I have generated random points in qgis and would like to assign the value of their geometry to a unique column in another table. I would like to do this in qgis or postgres or spatialite. Table A contains the random points and geometry. Table B contains non spatial data and an atrribute ogc_fid which is unique. I would love to assign for each unique ogc_fid the geom of one particular feature in Table A. Any ideas of how to do this. I am comfotable with sql

1 Answer 1


You could add row numbers to the points and then join points and non-spatial table based on row number and ogc_fid (assuming ogc_fid starts with 1).

  • Unfortunatelly the ogc_fid does not start at 1 and is not sequantial. It is a derived column based on postgres window function. Apr 25, 2015 at 14:53
  • Then add a row number in postgres
    – underdark
    Apr 25, 2015 at 15:02
  • Are there more points in table a than table b or equal numbers? Apr 25, 2015 at 19:00
  • Since table B is a derived one it has more values but the unique features equal the number in random points. Apr 25, 2015 at 20:02

Your Answer

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

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