Changeset 6395 for cowsserver


Ignore:
Timestamp:
25/01/10 13:01:26 (9 years ago)
Author:
pnorton
Message:

Changed the cows imports to reflect the new class positions.

Location:
cowsserver/trunk/lib/cowsserver
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cowsserver/trunk/lib/cowsserver/controllers/catalogue.py

    r6097 r6395  
    1616    def index(self): 
    1717         
     18        log.debug("starting catalog index action") 
     19         
    1820        c.allwxs=[] 
    1921        c.wfsonly=[] 
     
    2224        listwfsonly = list(globalCSMLConnector.listwfsonly()) 
    2325         
     26         
     27        log.debug("globalCSMLConnector.list() = %s" % ([x for x in globalCSMLConnector.list()],)) 
     28         
    2429        for fc in globalCSMLConnector.list(): 
    25             doc = globalCSMLConnector.getCsmlDoc(fc) 
    2630             
    27             if hasattr(doc, 'name'): 
    28                 fc_name = doc.name.CONTENT 
     31            if globalCSMLConnector.isGroup(fc): 
     32                fc_name = fc 
    2933            else: 
    30                 fc_name = fc 
    31              
     34                doc = globalCSMLConnector.getCsmlDoc(fc) 
     35                 
     36                if hasattr(doc, 'name'): 
     37                    fc_name = doc.name.CONTENT 
     38                else: 
     39                    fc_name = fc 
     40                 
    3241            if fc in listwfsonly: 
    3342                c.wfsonly.append((fc, fc_name) ) 
  • cowsserver/trunk/lib/cowsserver/controllers/coastwms.py

    r6145 r6395  
    77from cows.pylons import ows_controller 
    88from pylons import config 
    9 from cows.service.imps.data_reader_geoplot_backend.rendering_option import RenderingOption 
    10 from cows.service.imps.data_reader_geoplot_backend.slab_options_parser import SlabOptionsParser 
    11 from cows.service.imps.data_reader_geoplot_backend.slab_options_json_generator import SlabJSONGenerator 
     9from cows.service.imps.geoplot_wms_backend.rendering_option import RenderingOption 
     10from cows.service.imps.geoplot_wms_backend.slab_options_parser import SlabOptionsParser 
     11from cows.service.imps.geoplot_wms_backend.slab_options_json_generator import SlabJSONGenerator 
    1212from cows.model import WGS84BoundingBox, BoundingBox, Contents 
    1313from cows.exceptions import InvalidParameterValue 
  • cowsserver/trunk/lib/cowsserver/controllers/csmlwms.py

    r6072 r6395  
    44from geoplot.plot_lat_lon import PlotLatLon  
    55from geoplot.contour_plot import ContourPlot 
     6from geoplot.interval_plot import IntervalPlot 
    67 
    78from cows.pylons.wms_controller import WMSController 
    89from cows.pylons import ows_controller 
    9  
    10 from cows.service.imps.data_reader_geoplot_backend.data_reader_geoplot_layer_mapper import DRGeoplotLayerMapper 
    11 from cows.service.imps.data_reader_geoplot_backend.data_reader_geoplot_wms_layer import DRGeoplotWmsLayer 
    12 from cows.service.imps.data_reader_geoplot_backend.slab_options_json_generator import SlabJSONGenerator 
    13  
    14 DRGeoplotWmsLayer.EnableDisplayOptions = True 
    15 DRGeoplotWmsLayer.EnableXMLAxisConfig = True 
     10from cows.exceptions import InvalidParameterValue 
     11 
     12from cows.service.imps.geoplot_wms_backend.geoplot_layer_mapper import GeoplotLayerMapper 
     13from cows.service.imps.geoplot_wms_backend.geoplot_wms_layer import GeoplotWmsLayer 
     14from cows.service.imps.geoplot_wms_backend.slab_options_json_generator import SlabJSONGenerator 
     15 
     16GeoplotWmsLayer.EnableDisplayOptions = True 
     17GeoplotWmsLayer.EnableXMLAxisConfig = True 
    1618 
    1719from cowsserver.lib.base import request, response 
     
    2325 
    2426class CsmlwmsController(WMSController): 
    25     layerMapper = DRGeoplotLayerMapper() 
     27    layerMapper = GeoplotLayerMapper() 
    2628     
    2729    owsOperations = (WMSController.owsOperations + ['GetDisplayOptions','GetAxisConfig','GetFigure']) 
     
    4547        #create a list of names for each of the styles (each slabClass has its onw style) 
    4648        styleOptionsMap = {} 
    47         for klass in DRGeoplotWmsLayer.slab_classes: 
     49        for klass in GeoplotWmsLayer.slab_classes: 
    4850            styleOptionsMap[klass.style] = [x for x in klass.renderingOptions] 
    4951         
     
    107109         
    108110        log.debug("dimValues = %s" % (dimValues,)) 
    109         variable = layerObj.dataReader.getNetcdfVar(layerObj.name, dimValues) 
     111        variable = layerObj.dataReader.getNetcdfVar(layerObj.title, dimValues) 
    110112         
    111113                             
     
    136138        if 'intervalnames' in params: 
    137139            kwargs['intervalNames'] = params['intervalnames'].split(',') 
     140             
     141        if 'num_intervals' in params: 
     142            kwargs['numIntervals'] = int(params['num_intervals']) 
    138143         
    139144        if 'cmap_max' in params: 
     
    166171            log.debug("kwargs = %s" % (kwargs,)) 
    167172            plt = ContourPlot(cdmsVar=variable, **kwargs) 
    168              
     173         
     174        elif styles[0] == 'interval': 
     175             
     176            plt = IntervalPlot(cdmsVar=variable, **kwargs) 
     177         
    169178        else: 
    170179            raise Exception("unknown style %s" % (styles[0],)) 
  • cowsserver/trunk/lib/cowsserver/controllers/csmlwms_csml.py

    r6072 r6395  
    33 
    44from cows.pylons.wms_controller import WMSController 
    5 from cows.service.imps.csmlbackend.wms_csmllayer import CSMLwmsLayerMapper 
     5from cows.service.imps.csmlbackend.wms.csml_wms_layer_mapper import CSMLWmsLayerMapper 
    66 
    77from cowsserver.lib.wms_request_log_utils import buildLogString, wms_request_logger 
     
    1010 
    1111class CsmlwmsCsmlController(WMSController): 
    12     layerMapper = CSMLwmsLayerMapper() 
     12    layerMapper = CSMLWmsLayerMapper() 
    1313 
    1414     
  • cowsserver/trunk/lib/cowsserver/lib/base.py

    r6097 r6395  
    1313import cowsserver.lib.helpers as h 
    1414import cowsserver.model as model 
    15 from cows.service.imps.csmlbackend.csmlcommon import globalCSMLConnector 
     15from cows.service.imps.csmlbackend import getGlobalCSMLConnector 
     16 
     17globalCSMLConnector = getGlobalCSMLConnector() 
     18 
    1619from cows.pylons.ows_controller import templateLoader 
    1720 
  • cowsserver/trunk/lib/cowsserver/tests/owslib_tests/wms_test_image_download.py

    r6145 r6395  
    8686    outputDir = getOwsLibTestOutputDir() 
    8787     
     88    outputDir = '/data/pnorton/owslib_tests' 
     89     
    8890    wmsFolderPath = os.path.join(outputDir, wmsFolderName) 
    8991     
     
    9294     
    9395    for dataset, links in cowslinks: 
     96     
     97        if 'WMS' not in links: 
     98            continue 
    9499     
    95100        url = links['WMS'] 
     
    103108     
    104109    print "\nwms url = %s" % (url,) 
    105     wms = WebMapService(url)#, version='1.3.0') 
     110     
     111    try: 
     112        wms = WebMapService(url)#, version='1.3.0') 
     113         
     114    except: 
     115        print "\nexception getting capabilities for wms with url = %s\n" % (url,) 
     116        return 
     117                     
    106118    #print "get map formats = ", wms.getOperationByName('GetMap').formatOptions 
    107119    #print "operations = ", [op.name for op in wms.operations] 
     
    177189            os.sys.stdout.flush() 
    178190            i = i + 1 
    179              
    180         break 
    181      
     191                 
    182192    #convert *.png output.gif 
    183193 
Note: See TracChangeset for help on using the changeset viewer.