Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to update a single vector layer as I am working on 8 vector layers and they are getting fast data from serial port so for updating I use mapCanvas().refresh() which refresh all the layer and I have almost 20 static S57 layer so the refresh takes a long time.

share|improve this question
add comment

1 Answer 1

Not sure if there is a direct way at this date, but my guess there isn't. But this might help you:

http://osgeo-org.1803224.n2.nabble.com/refresh-one-layer-td4427445.html

It's kind of possible. From 1.4 release there's support for caching of rendered layers (turned off by default). You can turn it on in options dialog. Then always make sure to erase cache for the layer that has been changed (layer.setCacheImage(None)). It will get rendered again, while the rest of the layers should stay untouched (their cache image will be displayed).

share|improve this answer
    
no thats not working –  M.Umair Khan Jul 18 '11 at 7:24
    
That's strange, for me it is working. But I don't change extents or do any other modifications to other layers for example this fucntion: mainLayer = iface.activeLayer() mainLayer.invertSelection() iface.mapCanvas().refresh() was very long with no cache and very quick with it. –  Mykolas Simutis Jul 18 '11 at 7:53
    
kindly tell me the procedure I m using QGIS 1.6 –  user3700 Jul 19 '11 at 4:36
    
>kindly tell me the procedure I m using QGIS 1.6. I will comment it here. Firstly use 1.7. Go to Settings > Options>select Rendering>Use render caching where possible to speed up redraws. Restart Qgis (probably not needed, but whatever, will not hurt anybody). Now if you make changes to one layer only, qgis should leave the rest as they are. However if you zoom in/out/do other modifications for all layers, it will redraw all of them (tested by me). –  Mykolas Simutis Jul 19 '11 at 6:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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