TransWikia.com

Updating data from external table in real time using QGIS?

Geographic Information Systems Asked on December 13, 2021

I have been trying for a long time to connect a external table data[csv] through Excel (for exmaple) with QGis with the objective to each time i change any data in table(for example data location – coordinates [X ; Y]),this changes occur in QGis real time.

Is there any procedure to get it?.

One Answer

Although the original question was aimed at raster layers, the same procedure can be applied here with simple python scripting. See https://gis.stackexchange.com/a/58885/9839

from qgis.PyQt.QtCore import QFileSystemWatcher

def refreshLayer():
    myLayer.setCacheImage( None )
    myLayer.triggerRepaint()

watcher = QFileSystemWatcher()
watcher.addPath( '/path/to/your/csv' )
watcher.fileChanged.connect( refreshLayer )

Answered by Matthias Kuhn on December 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP