[Thuban-commits] r2868 - in trunk/thuban: . Extensions/wms
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Dec 8 09:50:54 CET 2008
Author: dpinte
Date: 2008-12-08 09:50:53 +0100 (Mon, 08 Dec 2008)
New Revision: 2868
Modified:
trunk/thuban/ChangeLog
trunk/thuban/Extensions/wms/layer.py
Log:
2008-12-03 Didrik Pinte <dpinte at dipole-consulting.com>
* Extensions/wms/layer.py : added a very simple caching mechanism
Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog 2008-12-03 14:31:01 UTC (rev 2867)
+++ trunk/thuban/ChangeLog 2008-12-08 08:50:53 UTC (rev 2868)
@@ -1,5 +1,9 @@
2008-12-03 Didrik Pinte <dpinte at dipole-consulting.com>
+ * Extensions/wms/layer.py : added a very simple caching mechanism
+
+2008-12-03 Didrik Pinte <dpinte at dipole-consulting.com>
+
* Extensions/wms/layer.py : bugfix in projection management
2008-11-18 Didrik Pinte <dpinte at dipole-consulting.com>
Modified: trunk/thuban/Extensions/wms/layer.py
===================================================================
--- trunk/thuban/Extensions/wms/layer.py 2008-12-03 14:31:01 UTC (rev 2867)
+++ trunk/thuban/Extensions/wms/layer.py 2008-12-08 08:50:53 UTC (rev 2868)
@@ -102,6 +102,7 @@
self.error_msg = None
self.wms_layers = []
self.capabilities = None
+ self.cached_bbox = None
# Change the cursor to demonstrate that we're busy but working
ThubanBeginBusyCursor()
@@ -331,6 +332,14 @@
bbox_dict = { 'minx': bbox[0], 'miny': bbox[1],
'maxx': bbox[2], 'maxy': bbox[3] }
+ if self.cached_bbox is not None:
+ for i in xrange(4):
+ if self.cached_bbox[i] != bbox[i]:
+ break
+ else:
+ if self.cached_response is not None:
+ return self.cached_response, self.format
+ self.cached_bbox = bbox
# Change the cursor to demonstrate that we're busy but working
ThubanBeginBusyCursor()
@@ -342,7 +351,9 @@
bbox=bbox,
size=(width, height),
format=self.wmsformat,
- transparent=True)
+ transparent=False)
+ self.cached_response = wms_response.read()
+
ThubanEndBusyCursor()
- return wms_response.read() , self.format
+ return self.cached_response , self.format
More information about the Thuban-commits
mailing list