Changeset 1117

Show
Ignore:
Timestamp:
06/24/08 05:11:54
Author:
domlowe
Message:

adding support for time to WMS client. Also a couple of minor bug fixes. The jpl wms capabilitites test is currently failing, but I think it is a problem with the server

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OWSLib/trunk/owslib/coverage/wcs110.py

    r1095 r1117  
    168168            u = urlopen(base_url, data=data) 
    169169        except: 
    170             u = urlopen(base_url+dat
     170            u = urlopen(base_url+data
    171171                 
    172172        # check for service exceptions, and return 
  • OWSLib/trunk/owslib/interfaces.py

    r1095 r1117  
    129129    crsOptions = property("""List of available coordinate/spatial reference systems (list).""") 
    130130    styles = property("""List of style dicts (list).""") 
    131  
     131    timepositions=property("""List of times for which data is available""") 
    132132 
    133133# XXX: needed? 
  • OWSLib/trunk/owslib/wms.py

    r1102 r1117  
    9999         
    100100        #serviceIdentification metadata 
    101         serviceelem=self._capabilities.find('Service/') 
     101        serviceelem=self._capabilities.find('Service') 
    102102        self.identification=ServiceIdentification(serviceelem, self.version)    
    103103         
     
    320320                self.boundingBox = None 
    321321                if b is not None: 
    322                         self.boundingBox = ( 
    323                                 float(b.attrib['minx']), 
    324                                 float(b.attrib['miny']), 
    325                                 float(b.attrib['maxx']), 
    326                                 float(b.attrib['maxy']), 
    327                                 b.attrib['SRS'], 
    328                         ) 
     322                    try: #sometimes the SRS attribute is (wrongly) not provided 
     323                        srs=b.attrib['SRS'] 
     324                    except KeyError: 
     325                        srs=None 
     326                    self.boundingBox = ( 
     327                            float(b.attrib['minx']), 
     328                            float(b.attrib['miny']), 
     329                            float(b.attrib['maxx']), 
     330                            float(b.attrib['maxy']), 
     331                            srs, 
     332                    ) 
    329333                elif self.parent: 
    330334                    if hasattr(self.parent, 'boundingBox'): 
     
    350354                        ## instead of several SRS tags. hence the inner loop 
    351355                        for srslist in map(lambda x: x.text, elem.findall('SRS')): 
     356                            if srslist: 
    352357                                for srs in srslist.split(): 
    353358                                        self.crsOptions.append(srs) 
     
    376381                self.keywords = [f.text for f in elem.findall('KeywordList/Keyword')] 
    377382 
     383                # timepositions - times for which data is available. 
     384                self.timepositions=None 
     385                for extent in elem.findall('Extent'): 
     386                    if extent.attrib.get("name").lower() =='time': 
     387                        self.timepositions=extent.text.split(',') 
     388                        break 
     389                 
    378390                self.layers = [] 
    379391                for child in elem.findall('Layer'): 
  • OWSLib/trunk/tests/wms_JPLCapabilities.txt

    r1097 r1117  
    108108    ['application/vnd.ogc.se_xml'] 
    109109 
    110 Lastly, test the getcapabilities method 
     110Lastly, test the getcapabilities and getmap methods 
    111111 
    112112    >>> wms = WebMapService('http://wms.jpl.nasa.gov/wms.cgi', version='1.1.1')