<html><head></head><body><div class="yahoo-style-wrap" style="font-family:times new roman, new york, times, serif;font-size:13px;"><div dir="ltr" data-setdir="false"><div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; clear: both; color: rgb(36, 39, 41); background-color: rgb(249, 248, 246);" dir="ltr" data-setdir="false">Hi All!</div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; clear: both; color: rgb(36, 39, 41); background-color: rgb(249, 248, 246);" dir="ltr" data-setdir="false"><br></div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; clear: both; color: rgb(36, 39, 41); background-color: rgb(249, 248, 246);">I am trying to understand the behavior of Layer->Render-> Refresh layer at interval in QGIS</div><ol style="margin-top: 0px; margin-right: 0px; margin-left: 30px; padding: 0px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; list-style-position: initial; list-style-image: initial; color: rgb(36, 39, 41); background-color: rgb(249, 248, 246);"><li style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">I sat up a flask rest api which serves a geojson.</li><li style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">I added the geojson to QGIS via Add Layer-> </li><ol><li style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">a. Protocol HTTP/cloud/etc </li><li style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">b. Type: HTTP </li><li style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">c.URI: localhost/points.geojson The points are represented on the map correctly</li></ol><li style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">I changed the layer->Properties->Rendering-> Refresh layer at interval (5 sec)</li></ol><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; clear: both; color: rgb(36, 39, 41); background-color: rgb(249, 248, 246);">I would have expected that there would be a call every 5 seconds towards the server and the map data would be updated accordingly. But the layer does not get refreshed. I don't see any changes neither when I remove a point from the json file on my local drive, nor if I change an attribute. If I press F5 then the canvas refreshes and it automatically loads the new data and I can see the changes. Is this the behavior that is wanted or am I misunderstanding the function of this tool? It seems like the data is cached somewhere?</p><pre class="ydpadbbb2c4default ydpadbbb2c4s-code-block ydpadbbb2c4hljs ydpadbbb2c4python" style="margin-top: 0px; margin-bottom: 0px; padding: 12px; border: 0px; font-stretch: inherit; line-height: 1.30769; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; width: auto; border-radius: 5px; min-height: 600px;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; background-color: transparent; white-space: inherit;"><span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">from</span> flask <span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">import</span> Flask
<span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">from</span> flask_restful <span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">import</span> Api, Resource
<span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">import</span> json

app = Flask(__name__)
api = Api(app)

<span class="ydpadbbb2c4hljs-class" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;"><span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">class</span> <span class="ydpadbbb2c4hljs-title" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">point</span>(<span class="ydpadbbb2c4hljs-params" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">Resource</span>):</span>

    <span class="ydpadbbb2c4hljs-function" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;"><span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">def</span> <span class="ydpadbbb2c4hljs-title" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">get</span>(<span class="ydpadbbb2c4hljs-params" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">self</span>):</span>
        <span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">with</span> open(<span class="ydpadbbb2c4hljs-string" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">'C:/points/venv/src/points.geojson'</span>) <span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">as</span> json_file:
            data = json.load(json_file)
        <span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">return</span> data

api.add_resource(point,<span class="ydpadbbb2c4hljs-string" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">"/points.geojson"</span>)

<span class="ydpadbbb2c4hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">if</span> __name__==<span class="ydpadbbb2c4hljs-string" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">"__main__"</span>:
    app.run(debug=<span class="ydpadbbb2c4hljs-literal" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">True)</span></code></pre><pre class="ydpadbbb2c4default ydpadbbb2c4s-code-block ydpadbbb2c4hljs ydpadbbb2c4python" style="margin-top: 0px; margin-bottom: 0px; padding: 12px; border: 0px; font-stretch: inherit; line-height: 1.30769; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; width: auto; border-radius: 5px; min-height: 600px;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; background-color: transparent; white-space: inherit;"><span class="ydpadbbb2c4hljs-literal" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">Robert Nagy</span></code></pre><pre class="ydpadbbb2c4default ydpadbbb2c4s-code-block ydpadbbb2c4hljs ydpadbbb2c4python" style="margin-top: 0px; margin-bottom: 0px; padding: 12px; border: 0px; font-stretch: inherit; line-height: 1.30769; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; width: auto; border-radius: 5px; min-height: 600px;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; background-color: transparent; white-space: inherit;"><br></code></pre></div><br></div></div></body></html>