qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.61k stars 3.01k forks source link

Periodically refreshing the rendering of a remote geojson layer doesn't work #28282

Open qgib opened 6 years ago

qgib commented 6 years ago

Author Name: c m (c m) Original Redmine Issue: 20462 Affected QGIS version: 3.4.0 Redmine category:vectors


I added a vector layer > Protocol > URI= url of a web api that returns a geojson feed.

Displayed OK (inside QGIS Desktop 3.4)

If I go into layers's properties > Rendering > checkbox "Refresh layer every (seconds)" > checked & added a value (60 for instance) But my layer's data never gets updated after that

Though refreshing (of the layer's data source + rendering) works if I click on the refresh button (F5) inside QGIS Desktop

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


Does it happens only with that specific type of datasource?


qgib commented 6 years ago

Author Name: c m (c m)


I tried with other vector layer's sources, i.e data coming from MSSQLServer or a postGIS db. And the same thing happens : no (visible) refresh.

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 5 years ago

Author Name: Paul Blottiere (Paul Blottiere)


Hi @c m,

I tried the "Refresh layer every (seconds)" option on master and 3.4 release (with SHP and Postgis layer), and everything seems to be fine.

Can you check the "Map canvas refresh" option in Settings -> Options... -> Rendering -> Debugging.

This way, you should have some prints in the rendering log for each refresh:

2019-02-15T11:05:37 WARNING 1 ms: array_tbl_a9a0662f_ecbc_4b7d_94a1_ae23900890ed 2019-02-15T11:05:37 WARNING 1 ms: Labeling 2019-02-15T11:05:37 WARNING --- 2019-02-15T11:05:37 WARNING 5 ms: array_tbl_a9a0662f_ecbc_4b7d_94a1_ae23900890ed 2019-02-15T11:05:37 WARNING 1 ms: Labeling 2019-02-15T11:05:37 WARNING --- 2019-02-15T11:05:37 WARNING Canvas refresh: 12 ms


qgib commented 5 years ago

Author Name: c m (c m)


Ok thanks for checking !

might be related with something else, like checkbox/textbox's values may not be saved/applied on the first time, but ok when re-opening the project.

qgib commented 5 years ago

Author Name: c m (c m)


I checked the "Map canvas refresh" option in Settings -> Options... -> Rendering -> Debugging. And everything seems ok to me in the rendering log

qgib commented 5 years ago

Author Name: Paul Blottiere (Paul Blottiere)


And everything seems ok to me in the rendering log

So if "Refresh layer every (seconds)" is set with 1 second, do you observe a new message in the rendering log every second?

qgib commented 5 years ago

Author Name: c m (c m)


Yes I do.

But in case of

qgib commented 5 years ago

Author Name: Giovanni Manghi (@gioman)


  • a layer linked with a http feed (add vector > protocol > geojson) supplying a geojson feed (web api) : the layer doesn't get updated. I don't see the canvas blink, nothing changed. Though there's some message in the rendering log, and the refresh works if I click on the refresh button (F5).

this seems duplicate of #28744

qgib commented 5 years ago

Author Name: c m (c m)


I wouldn't say that, because here (#28282) : "the refresh works if I click on the refresh button (F5)" though with #28744 : "Cant be refreshed - need to close QGIS and reopen to see updates. F5 key does not refresh"

qgib commented 5 years ago

Author Name: Giovanni Manghi (@gioman)


because here (#28282) : "the refresh works if I click on the refresh button (F5)"

was this really working as expected on 2.*?


gioman commented 4 years ago

Tried with https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson and seems to be still the case.

Can't confirm with PostGIS.

rduivenvoorde commented 4 years ago

I created a simple test service: https://duif.net/geotest/points.geojson On every call to it, it returns another point with random coordinate.

Reading both issues here, I tried to both load them as protocol AND as file, enabled the rendering debug, and set the refresh rate for rendering on 2 secs:

refreshgeojson.zip

Very strange effect: the mapcanvas is repainted every 2 seconds, BUT without requesting the data every time, AND the 2 layers (differently styles) change there style (they mixup each others styles)... ???

(sorry screencast is broken...) But you will see the green and red dot change position...

Screenshot-20201102145019-911x679

Pedro-Murteira commented 2 years ago

This is still valid on QGIS 3.22.3.