Ignore:
Timestamp:
07/03/08 10:28:58 (12 years ago)
Author:
spascoe
Message:

Several bugs that were making the Capabilities document invalid.

The DDP test WMS server is now viewable through Cadcorp's Map Browser.

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  
    3737        'image/tiff': 'TIFF' 
    3838        } 
     39    _layerSlabCache = {} 
    3940 
    4041    #------------------------------------------------------------------------- 
     
    9495            ds = WmsDatasetSummary(identifier=layerName, 
    9596                                   titles=[layer.title], 
     97                                   CRSs=layer.crss, 
    9698                                   boundingBoxes=bboxObjs, 
    97                                    abstracts=[layer.abstract]) 
     99                                   abstracts=[layer.abstract], 
     100                                   dimensions=dims) 
    98101 
    99102            c.capabilities.contents.datasetSummaries.append(ds) 
     
    123126            raise InvalidParameterValue('Layer %s not found' % layerName, 'layers') 
    124127 
    125                  
     128         
    126129        # Coordinate parameters 
    127130        bbox = tuple(float(x) for x in self.getOwsParam('bbox').split(',')) 
     
    142145        for dimName, dim in layerObj.dimensions.items(): 
    143146            defaultValue = dim.extent[0] 
    144             dimValues[dimName] = self.getOwsParam('time', default=defaultValue) 
    145  
     147            dimValues[dimName] = self.getOwsParam(dimName, default=defaultValue) 
     148             
     149        #--------------------------------------------------------------------- 
    146150        # The real work 
    147151        #!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 
    149160 
    150161        # We must request a bbox within the layer's bbox. 
     
    156167        log.debug('ibbox = %s' % (ibbox,)) 
    157168 
    158         # If bbox is not within layerObj.bbox then we need to calculate the pixel 
    159         # offset of the inner bbox, request the right width/height and paste the 
    160         # image into a blank background 
     169        # 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 
    161172        if bbox == ibbox: 
    162173            img = slab.getImage(bbox, width, height) 
Note: See TracChangeset for help on using the changeset viewer.