Changeset 3561 for TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/wms_controller.py
- Timestamp:
- 07/03/08 10:28:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/wms_controller.py
r3554 r3561 37 37 'image/tiff': 'TIFF' 38 38 } 39 _layerSlabCache = {} 39 40 40 41 #------------------------------------------------------------------------- … … 94 95 ds = WmsDatasetSummary(identifier=layerName, 95 96 titles=[layer.title], 97 CRSs=layer.crss, 96 98 boundingBoxes=bboxObjs, 97 abstracts=[layer.abstract]) 99 abstracts=[layer.abstract], 100 dimensions=dims) 98 101 99 102 c.capabilities.contents.datasetSummaries.append(ds) … … 123 126 raise InvalidParameterValue('Layer %s not found' % layerName, 'layers') 124 127 125 128 126 129 # Coordinate parameters 127 130 bbox = tuple(float(x) for x in self.getOwsParam('bbox').split(',')) … … 142 145 for dimName, dim in layerObj.dimensions.items(): 143 146 defaultValue = dim.extent[0] 144 dimValues[dimName] = self.getOwsParam('time', default=defaultValue) 145 147 dimValues[dimName] = self.getOwsParam(dimName, default=defaultValue) 148 149 #--------------------------------------------------------------------- 146 150 # The real work 147 151 #!TODO: Minimum and maximum values 148 slab = layerObj.getSlab(srs, dimValues, dict(minValue=0, maxValue=100)) 152 153 # Find the slab in the cache first 154 cacheKey = layerObj.getCacheKey(srs, dimValues) 155 try: 156 slab = self._layerSlabCache[cacheKey] 157 except KeyError: 158 slab = layerObj.getSlab(srs, dimValues, dict(minValue=0, maxValue=100)) 159 self._layerSlabCache[cacheKey] = slab 149 160 150 161 # We must request a bbox within the layer's bbox. … … 156 167 log.debug('ibbox = %s' % (ibbox,)) 157 168 158 # If bbox is not within layerObj.bbox then we need to calculate the pixel159 # offset of the inner bbox, request the right width/height and paste the160 # image into a blank background169 # If bbox is not within layerObj.bbox then we need to calculate the 170 # pixel offset of the inner bbox, request the right width/height 171 # and paste the image into a blank background 161 172 if bbox == ibbox: 162 173 img = slab.getImage(bbox, width, height)
Note: See TracChangeset
for help on using the changeset viewer.