Changeset 4031 for DPPP


Ignore:
Timestamp:
27/06/08 11:56:26 (11 years ago)
Author:
spascoe
Message:

Moving to COWS. Untested so far

Location:
DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/controllers/ukcip_wms.py

    r3565 r4031  
    77from ukcip_server.lib.base import * 
    88from ukcip_server.model.ukcip02 import UKCIP02LayerMapper 
    9 from ows_common.pylons.wms_controller import WMSController 
     9from cows.pylons.wms_controller import WMSController 
    1010 
    1111log = logging.getLogger(__name__) 
  • DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/model/__init__.py

    r3551 r4031  
    22#import ukcip02 
    33 
    4 from ows_common.pylons.model import setLayerMapper 
    5 from ows_common.service.wms_iface import ILayerMapper 
     4from cows.pylons.model import setLayerMapper 
     5from cows.service.wms_iface import ILayerMapper 
    66from sample_layer import TestcardLayer 
    77 
     
    1919        return dict(test=testLayer) 
    2020 
    21 # Register the LayerMapper with ows_common 
     21# Register the LayerMapper with cows 
    2222setLayerMapper(LayerMapper()) 
  • DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/model/pywms/impl.py

    r3668 r4031  
    3030 
    3131    """ 
     32 
     33    featureInfoFormats = ['text/html'] 
     34     
    3235    def __init__(self, cdmsVar, GridClass=CdmsGrid, minValue=None, maxValue=None, 
    3336                 units=None): 
     
    3942        self._layer = SimpleCdmsLayer(cdmsVar, GridClass=GridClass) 
    4043        self.abstract = None 
    41         self.crss = [GridClass.crs, 'EPSG:27700'] 
     44        self.crss = [GridClass.crs] 
     45        #!TODO: do this properly 
     46        self.wgs84BBox = (-15.0, 45.0, 15.0, 60.0) 
    4247        if units: 
    4348            self.units = units 
     
    5358            dims[dimName] = Dimension(dim) 
    5459        self.dimensions = dims 
    55  
    56          
    57  
    5860 
    5961    def getBBox(self, crs): 
     
    9092        loc = LinearLocator() 
    9193        loc.set_bounds(self.minValue, self.maxValue) 
    92         ColorbarBase(ax, boundaries=boundaries, orientation=orientation, ticks=loc()) 
     94        ColorbarBase(ax, boundaries=boundaries, orientation=orientation, ticks=loc(), 
     95                     cmap=get_cmap(renderOpts.get('cmap', 'Paired'))) 
    9396 
    9497        if 'vert' in orientation: 
     
    106109        return img 
    107110 
     111    def getFeatureInfo(self, format, crs, point, dimValues): 
     112        # We assume here format and crs are valid (the framework should check). 
     113        (x, y) = point 
     114 
     115        var = self._layer.var 
     116        # Get the data at that point 
     117        sel = dict(eastings=x, northings=y) 
     118        # Ignore dimvalues 
     119        # sel.update(dimValues) 
     120        val = var(**sel) 
     121         
     122        return ''' 
     123<html> 
     124<body> 
     125<h1>GetFeatureInfoResponse for layer: %s</h1> 
     126Selection: %s<br/> 
     127Value: %s<br/> 
     128</body> 
     129</html> 
     130''' % (self.title, sel, val) 
     131         
     132 
    108133class CdmsLayerSlab(ILayerSlab): 
    109134    def __init__(self, crs, dimValues, renderOpts, layer): 
     
    118143    def getImage(self, bbox, width, height): 
    119144        grid = self.layer._layer.selectGrid(bbox, self.dimValues) 
    120         cmap = get_cmap(self.renderOpts.get('cmap', 'jet')) 
     145        cmap = get_cmap(self.renderOpts.get('cmap', 'Paired')) 
    121146        img = self._renderer.renderGrid(grid, bbox, width, height, cmap) 
    122147 
  • DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/model/sample_layer.py

    r3565 r4031  
    11""" 
    2 An experiment to implement ows_common.service.wms_iface for a test-card. 
     2An experiment to implement cows.service.wms_iface for a test-card. 
    33 
    44""" 
    55 
    6 from ows_common.service.wms_iface import ILayer, ILayerMapper, ILayerSlab, IDimension 
    7 from ows_common import bbox_util 
     6from cows.service.wms_iface import ILayer, ILayerMapper, ILayerSlab, IDimension 
     7from cows import bbox_util 
    88 
    99import Image, ImageDraw, ImageFont 
  • DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/model/ukcip02.py

    r3572 r4031  
    1010from ukcip_server.model.pywms.wms_cdms import CdmsBNGGrid 
    1111from ukcip_server.model.pywms.impl import CdmsLayer 
    12 from ows_common.service.wms_iface import ILayerMapper 
     12from cows.service.wms_iface import ILayerMapper 
    1313 
    1414import cdms2 as cdms 
Note: See TracChangeset for help on using the changeset viewer.