2

I am building/editing a table and utilising Excel as the vehicle. When I change the spreadsheet I need to produce a new csv file and then re-import to generate new layers. Handling Excel spreadsheet in QGIS? gives me some options.

But would it be easier to use a database for the process? I can update/edit the database which could then automatically update the layers? (Postgis, Spatiallite, GeoPackage?) If so, which database should I be moving to? There will be a steep learning curve for all of them.

IanGS
  • 316
  • 1
  • 12
  • 1
    We use an R script to upload a CSV to a PostGIS table. We then notify QGIS to the change and see the results straight away. – AWGIS Jun 21 '19 at 14:23
  • Is it feasible to do away with the excel sheet and edit direct in PostGis? – IanGS Jun 21 '19 at 14:28
  • 1
    Yes it is feasible - we chose to do it this way because many of our analysts are far more familiar with Excel and it's functionality. We do also have an online interface which was developed for data entry into PostGIS but this is costly and lengthy to implement if you need a lot of built in logic. – AWGIS Jun 21 '19 at 14:30
  • 2
    @IanGS - If you load it as a delimited text layer, you could enable the Watch file option which updates the layer when any changes are made/saved to the csv file. – Joseph Jun 21 '19 at 14:32
  • So I can transfer in my excel sheet in PostGis as a one-off. Then continue to edit/tweak my data as required directly in PostGis. The layers in QGIS will be updated once I 'notify' it. is my basic understanding correct? – IanGS Jun 21 '19 at 14:34
  • 1
    @IanGS yes that is correct - you can also edit in QGIS which will update the PostGIS table if you allow yourself permission to do so. Is it mainly data entry or do you need to run cross-field calculations? Joseph's comment is also a good one but I have never tried it. – AWGIS Jun 21 '19 at 14:41
  • 1
    have done both, watch files (from the web so cannot change the format etc) and postgis - postgres wins as qgis can visualize the change much faster on bigger datasets almost in real-time. – Mapperz Jun 21 '19 at 16:35
  • @AWGIS I have now spent the weekend investigating POSTGIS and Postgresql - very poweful, I agree with your suggestions. Could you give me more on "use an R script to upload a CSV to a PostGIS table" and " notify QGIS to the change"? – IanGS Jun 25 '19 at 08:51
  • 2
    @IanGS I'm glad you agree. We certainly like it! In terms of "notifying QGIS" this source explains it much better than I ever could https://kartoza.com/en/blog/using-pgnotify-to-automatically-refresh-layers-in-qgis/ – AWGIS Jun 25 '19 at 09:16
  • 1
    @IanGS it sounds to me like you only need to do the upload once if you are planning on using PostGIS to maintain updates. If that is the case then it would be much easier for you to just upload the csv in PostgreSGL – AWGIS Jun 25 '19 at 09:18

0 Answers0