Changeset 4351 for cows/trunk/cows


Ignore:
Timestamp:
22/10/08 10:44:34 (11 years ago)
Author:
domlowe
Message:

various small changes to csml backend

Location:
cows/trunk/cows/service/imps/csmlbackend
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/service/imps/csmlbackend/csmlcommon.py

    r4289 r4351  
    99import ConfigParser 
    1010log = logging.getLogger(__name__) 
     11from cows.bbox_util import union 
    1112  
    1213try: 
     
    2930        self.connector=CSMLConnector() 
    3031     
    31     def _getInfo(self, feature): 
     32    def getInfo(self, feature): 
    3233        ''' given a csml feature, return basic info about the layer/feature 
    3334        @return:   title, abstract''' 
     
    5152        pass 
    5253     
    53     def get_csml_doc(self, fileoruri): 
     54    def getCsmlDoc(self, fileoruri): 
    5455        """ 
    5556        Gets a csml document from file or exist when passed a file name or uri          
     
    8687     
    8788class BboxAggregator(object): 
    88     """ class to handle aggregations of bounding boxes (in the same crs)""" 
     89    """ class to handle aggregations of bounding boxes (in the same crs) and store state for further comparisons""" 
    8990    def __init__(self, initialbbox): 
    9091        """  
     
    99100#        log.debug('Comparing new bbox %s with old bbox %s'%(newbbox, self.bbox)) 
    100101        #compare new box with old. 
    101         if newbbox[0] < self.bbox[0]: 
    102             self.bbox[0]=newbbox[0] 
    103         if newbbox[1] < self.bbox[1]: 
    104             self.bbox[1]=newbbox[1] 
    105         if newbbox[2] > self.bbox[2]: 
    106             self.bbox[2]=newbbox[2] 
    107         if newbbox[3] > self.bbox[3]: 
    108             self.bbox[3]=newbbox[3] 
    109         return self.bbox 
     102        return union(self.bbox, newbbox) 
  • cows/trunk/cows/service/imps/csmlbackend/csmltests/test_csmllayer.py

    r4270 r4351  
    1 import wms_csmllayer 
     1import cows.service.imps.csmlbackend.wms_csmllayer 
    22import csml 
    33 
     4#TODO: This test is out of date, needs updating and moving to cows.tests  
    45 
    56def test_layerMapper(): 
    6     lm=wms_csmllayer.CSMLLayerMapper() 
     7    lm=wms_csmllayer.CSMLwmsLayerMapper() 
    78    print 'building layermap' 
    89    file='hadgem1' 
  • cows/trunk/cows/service/imps/csmlbackend/wfs_csmllayer.py

    r4312 r4351  
    4343            return self.layermapcache[fileoruri], self.featureinstancecache[fileoruri] 
    4444          
    45         ds = self.connector.get_csml_doc(fileoruri) 
     45        ds = self.connector.getCsmlDoc(fileoruri) 
    4646         
    4747        #The WFS differs from WMS & WCS in that the contents layer is a list of  
     
    5353 
    5454        for feature in csml.csmllibs.csmlextra.listify(ds.featureCollection.featureMembers): 
    55             title, abstract=self._getInfo(feature) 
     55            title, abstract=self.getInfo(feature) 
    5656            featureset.featureinstances[feature.id]=CSMLFeatureInstance(title, abstract, feature)              
    5757        for id, instance in featureset.featureinstances.iteritems(): 
  • cows/trunk/cows/service/imps/csmlbackend/wms_csmllayer.py

    r4278 r4351  
    3535        super(CSMLwmsLayerMapper, self).__init__() 
    3636     
    37     def _getInfo(self, feature): 
     37    def getInfo(self, feature): 
    3838        ''' given a csml feature, return info about the layer/feature 
    3939        @return:   title, abstract, dimensions, units, crss ''' 
    4040 
    41         title, abstract = super(CSMLwmsLayerMapper, self)._getInfo(feature) 
     41        title, abstract = super(CSMLwmsLayerMapper, self).getInfo(feature) 
    4242        units=feature.getDomainUnits() 
    4343        dimensions={} 
Note: See TracChangeset for help on using the changeset viewer.