Changeset 4982


Ignore:
Timestamp:
16/02/09 15:09:25 (11 years ago)
Author:
domlowe
Message:

tests now point at famous test subset, formatting capabilities template

Location:
cows/trunk/cows
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/templates/wcs_capabilities_1_0_0.xml

    r4955 r4982  
    11<?xml version="1.0"?> 
    2 <!DOCTYPE WMT_MS_Capabilities SYSTEM 
    3  "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"> 
    4  
    52<?python 
    63 
     
    118<!--! TODO: This currently looks like WMS, change to WCS based on old kid template --> 
    129 
    13 <WCS_Capabilities xmlns:py="http://genshi.edgewall.org/" xmlns="http://www.opengis.net/wcs" xmlns:gml="http://www.opengis.net/gml" 
    14                     version="1.0.0"> 
     10<WCS_Capabilities xmlns:py="http://genshi.edgewall.org/" xmlns="http://www.opengis.net/wcs" 
     11  xmlns:gml="http://www.opengis.net/gml" version="1.0.0"> 
    1512 
    1613  <!--! ====================================================================== --> 
     
    2219  <Operation py:def="_opContent(op)"> 
    2320    <Format py:for="f in op.parameters['Format'].possibleValues.allowedValues" py:content="f"/> 
    24     <DCPType><HTTP> 
    25       <Get> 
    26         <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"  
    27                         xlink:href="${op.get.href}"/> 
    28       </Get> 
    29     </HTTP></DCPType> 
     21    <DCPType> 
     22      <HTTP> 
     23        <Get> 
     24          <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" 
     25            xlink:href="${op.get.href}"/> 
     26        </Get> 
     27      </HTTP> 
     28    </DCPType> 
    3029  </Operation> 
    31   <?python 
    32    
    33   def markupOperation(opName, op): 
     30  <?python def markupOperation(opName, op): 
    3431    """Render an OWS operation description for the Capabilities section. 
    3532    """ 
     
    4542    <SRS py:for="crs in ds.CRSs" py:content="crs"/> 
    4643    <py:for each="bb in ds.boundingBoxes"> 
    47           <lonLatEnvelope> 
    48                   <gml:pos>${'%.2f'%bb.lowerCorner[0]} ${'%.2f'%bb.lowerCorner[1]}</gml:pos> 
    49                   <gml:pos>${'%.2f'%bb.upperCorner[0]} ${'%.2f'%bb.upperCorner[1]}</gml:pos> 
    50                   <gml:timePosition>${str(ds.timeLimits[0]) + 'Z'}</gml:timePosition> 
    51                   <gml:timePosition>${str(ds.timeLimits[1]) + 'Z'}</gml:timePosition> 
    52           </lonLatEnvelope>      
     44      <lonLatEnvelope> 
     45        <gml:pos>${'%.2f'%bb.lowerCorner[0]} ${'%.2f'%bb.lowerCorner[1]}</gml:pos> 
     46        <gml:pos>${'%.2f'%bb.upperCorner[0]} ${'%.2f'%bb.upperCorner[1]}</gml:pos> 
     47        <gml:timePosition>${str(ds.timeLimits[0]) + 'Z'}</gml:timePosition> 
     48        <gml:timePosition>${str(ds.timeLimits[1]) + 'Z'}</gml:timePosition> 
     49      </lonLatEnvelope> 
    5350    </py:for> 
    5451  </CoverageOfferingBrief> 
     
    5754 
    5855 
    59   <Service py:with="sm=c.capabilities; si=c.capabilities.serviceIdentification">   
     56  <Service py:with="sm=c.capabilities; si=c.capabilities.serviceIdentification"> 
    6057    <description py:if="len(si.abstracts)>0" py:content="si.abstracts[0]"/> 
    61         <name>OGC:WCS</name> 
     58    <name>OGC:WCS</name> 
    6259    <label py:content="si.titles[0]"/> 
    6360    <keywords py:if="len(si.keywords) is not 0"> 
    64       <keyword py:for="kw in si.keywords" 
    65                py:content="kw"/> 
     61      <keyword py:for="kw in si.keywords" py:content="kw"/> 
    6662    </keywords> 
    6763 
    6864    <responsibleParty py:if="sm.serviceProvider is not None" 
    69                         py:with="rp=sm.serviceProvider.serviceContact"> 
    70         <individualName py:if="rp is not None" py:content="rp.individualName"/> 
    71         <organisationName py:content="sm.serviceProvider.providerName"/> 
     65      py:with="rp=sm.serviceProvider.serviceContact"> 
     66      <individualName py:if="rp is not None" py:content="rp.individualName"/> 
     67      <organisationName py:content="sm.serviceProvider.providerName"/> 
    7268      <positionName py:content="rp.positionName"/> 
    7369 
    74      <py:with vars="cn=rp.contactInfo" py:if="rp.contactInfo is not None"> 
    75 <contactInfo> 
    76                 <phone> 
    77                         <voice py:if="cn.phone is not None" 
    78                                py:content="cn.phone.voice"/> 
    79                         <facsimile py:if="cn.phone is not None" 
    80                                    py:content="cn.phone.facsimile"/> 
    81                 </phone> 
    82                 <address py:if="cn.address is not None"> 
     70      <py:with vars="cn=rp.contactInfo" py:if="rp.contactInfo is not None"> 
     71        <contactInfo> 
     72          <phone> 
     73            <voice py:if="cn.phone is not None" py:content="cn.phone.voice"/> 
     74            <facsimile py:if="cn.phone is not None" py:content="cn.phone.facsimile"/> 
     75          </phone> 
     76          <address py:if="cn.address is not None"> 
    8377                        <deliveryPoint><py:for each="d in cn.address.deliveryPoints">${d}</py:for></deliveryPoint> 
    8478                        <city py:content="cn.address.city"/> 
    8579                        <administrativeArea py:content="cn.address.administrativeArea"/> 
    8680                        <postalCode py:content="cn.address.postalCode"/> 
    87                         <country  py:content="cn.address.country"/> 
    88                         <electronicMailAddress  py:if="cn.address is not None" 
    89                                       py:content="cn.address.electronicMailAddress"/> 
     81                        <country py:content="cn.address.country"/> 
     82                        <electronicMailAddress py:if="cn.address is not None" py:content="cn.address.electronicMailAddress"/> 
    9083                </address> 
    91     </contactInfo> 
    92     </py:with> 
     84        </contactInfo> 
     85      </py:with> 
    9386    </responsibleParty> 
    94      
     87 
    9588    <fees py:content="si.fees"/> 
    9689    <accessConstraints py:content="si.accessConstraints"/> 
    9790  </Service> 
    98    
     91 
    9992  <!--! These fields are represented in ows_common as service constraints --> 
    10093  <Capability py:with="sm=c.capabilities; om=sm.operationsMetadata"> 
     
    10295      <?python ops = ['GetCapabilities', 'DescribeCoverage', 'GetCoverage'] ?> 
    10396      <Request> 
    104         <py:for each="opName in ops" py:if="opName in om.operationDict.keys()"> 
    105           <span py:content="markupOperation(opName, om.operationDict[opName])" py:strip="True"/> 
    106         </py:for> 
    107         <py:for each="opName in ops" py:if="opName in om.operationDict.keys()"> 
    108           <?python exceptions = om.operationDict[opName].parameters.get('ExceptionFormat') ?> 
    109           <Exception py:if="exceptions is not None"> 
    110             <Format py:for="e in exceptions.possibleValues.allowedValues" 
    111                     py:content="e"/> 
    112           </Exception> 
    113         </py:for> 
     97        <py:for each="opName in ops" py:if="opName in om.operationDict.keys()"> 
     98          <span py:content="markupOperation(opName, om.operationDict[opName])" py:strip="True"/> 
     99        </py:for> 
     100        <py:for each="opName in ops" py:if="opName in om.operationDict.keys()"> 
     101          <?python exceptions = om.operationDict[opName].parameters.get('ExceptionFormat') ?> 
     102          <Exception py:if="exceptions is not None"> 
     103            <Format py:for="e in exceptions.possibleValues.allowedValues" py:content="e"/> 
     104          </Exception> 
     105        </py:for> 
    114106      </Request> 
    115107    </py:if> 
    116      
     108 
    117109    <!--!TODO:  capability exceptions --> 
    118     <Exception><Format>text/xml</Format></Exception> 
    119         </Capability> 
    120         <py:with vars="sm=c.capabilities"> 
     110    <Exception> 
     111      <Format>text/xml</Format> 
     112    </Exception> 
     113  </Capability> 
     114  <py:with vars="sm=c.capabilities"> 
    121115    <ContentMetadata py:if="sm.contents is not None"> 
    122116      <Title>Contents</Title> 
    123117      <CoverageOfferingBrief py:for="ds in sm.contents.datasetSummaries" 
    124              py:replace="markupLayer(ds)"> 
    125       </CoverageOfferingBrief> 
     118        py:replace="markupLayer(ds)"> </CoverageOfferingBrief> 
    126119    </ContentMetadata> 
    127         </py:with> 
     120  </py:with> 
    128121</WCS_Capabilities> 
  • cows/trunk/cows/test/owslibdoctests/wcs_mainoperations.txt

    r4852 r4982  
    77 
    88    >>> from owslib.wcs import WebCoverageService 
    9     >>> wcs=WebCoverageService('http://localhost:5000/famous_control_month/wcs', version='1.0.0') 
     9    >>> wcs=WebCoverageService('http://localhost:5000/famous/wcs', version='1.0.0') 
    1010    >>> wcs.url 
    11     'http://localhost:5000/famous_control_month/wcs' 
     11    'http://localhost:5000/famous/wcs' 
    1212    >>> wcs.version 
    1313    '1.0.0' 
     
    4444    'UK' 
    4545    >>> for item in wcs.items(): print item[0] 
    46     toa_incoming_shortwave_flux 
    47     runoff_flux 
    48     surface_downwelling_shortwave_flux_in_air 
    49     surface_downward_northward_stress 
    50     surface_upward_sensible_heat_flux 
    51     specific_humidity 
    52     surface_air_pressure 
     46    sea_ice_thickness 
    5347    air_temperature 
    54     eastward_wind 
    55     relative_humidity_2 
    56     tendency_of_sea_ice_thickness_due_to_thermodynamics 
    57     sea_ice_thickness 
    58     sea_ice_area_fraction 
    59     surface_upward_water_vapor_flux 
    60     ocean_meridional_overturning_streamfunction_4 
    61     eastward_wind_2 
    62     air_pressure_at_sea_level 
     48    sea_water_salinity 
    6349    cloud_area_fraction 
    64     ocean_meridional_overturning_streamfunction_2 
    65     ocean_meridional_overturning_streamfunction_3 
    66     sea_water_salinity 
    67     eastward_sea_water_velocity 
    68     surface_downward_eastward_stress 
    69     surface_downwelling_longwave_flux_in_air 
    70     northward_wind 
    71     air_temperature_2 
    72     sea_water_potential_temperature 
    73     tendency_of_sea_ice_thickness_due_to_dynamics 
    74     northward_sea_water_velocity 
    75     surface_downward_heat_flux_in_sea_water 
    76     toa_outgoing_shortwave_flux 
    77     surface_snow_amount 
    78     upward_sea_water_velocity 
    79     toa_outgoing_longwave_flux 
    80     geopotential_height 
    81     surface_upwelling_longwave_flux_in_air 
    82     surface_upwelling_shortwave_flux_in_air 
    83     water_flux_into_ocean 
    84     surface_temperature 
    85     ocean_meridional_overturning_streamfunction 
    86     surface_upward_latent_heat_flux 
    87     relative_humidity 
    88     northward_wind_2 
    89     precipitation_flux 
    90     >>> cvg=wcs['surface_temperature'] 
     50    >>> cvg=wcs['air_temperature'] 
    9151    >>> cvg.title 
    92     'surface_temperature' 
     52    'air_temperature' 
    9353    >>> cvg.keywords 
    9454    [] 
     
    9858    (-180.0, -90.0, 180.0, 90.0) 
    9959    >>> cvg.timelimits 
    100     ['2792-12-16T00:00:00.0Z', '2992-11-16T00:00:00.0Z'] 
     60    ['2793-06-01T00:00:00.0Z', '2932-06-01T00:00:00.0Z'] 
    10161    >>> cvg.supportedFormats 
    10262    [] 
    10363    >>> cvg.supportedCRS 
    10464    [] 
    105     >>> output=wcs.getCoverage(identifier='surface_temperature',time=['2992-11-16T00:00:00.0'],bbox=(-80,30,50,60), crs='WGS84', format='cf-netcdf') 
     65    >>> output=wcs.getCoverage(identifier='air_temperature',time=['2992-11-16T00:00:00.0'],bbox=(-80,30,50,60), crs='WGS84', format='cf-netcdf') 
    10666    >>> f=open('test.nc', 'wb') 
    10767    >>> f.write(output.read()) 
  • cows/trunk/cows/test/owslibdoctests/wms_mainoperations.txt

    r4858 r4982  
    77 
    88    >>> from owslib.wms import WebMapService 
    9     >>> wms=WebMapService('http://localhost:5000/famous_control_month/csml_WMS', version='1.1.1') 
     9    >>> wms=WebMapService('http://localhost:5000/famous/wms', version='1.1.1') 
    1010    >>> wms.url 
    11     'http://localhost:5000/famous_control_month/csml_WMS' 
     11    'http://localhost:5000/famous/wms' 
    1212    >>> wms.version 
    1313    '1.1.1' 
     
    2424    'British Atmospheric Data Centre' 
    2525    >>> wms.provider.url 
    26     'http://localhost:5000/famous_control_month/csml_WMS?' 
     26    'http://localhost:5000/famous/wms?' 
    2727    >>> wms.provider.contact.email 
    2828    'D.Lowe@rl.ac.uk' 
     
    4141    >>> wms.provider.contact.country 
    4242    'UK' 
    43     >>> for item in wms.items(): print item[0]; break 
    44     toa_incoming_shortwave_flux 
    45     >>> layer=wms['surface_temperature'] 
     43    >>> for item in wms.items(): print item[0] 
     44    None 
     45    sea_ice_thickness 
     46    air_temperature 
     47    sea_water_salinity 
     48    cloud_area_fraction 
     49    >>> layer=wms['sea_water_salinity'] 
    4650    >>> layer.title 
    47     'surface_temperature' 
     51    'sea_water_salinity' 
    4852    >>> layer.keywords 
    4953    [] 
     
    5155    (-180.0, -90.0, 180.0, 90.0, 'EPSG:4326') 
    5256    >>> layer.timepositions[0] 
    53     '2792-12-16T00:00:00.0' 
     57    '2793-06-01T00:00:00.0' 
    5458    >>> wms.getOperationByName('GetMap').formatOptions 
    5559    ['image/gif', 'image/png', 'image/jpg', 'image/tiff'] 
    56     >>> output=wms.getmap(layers=['surface_temperature'],time='2992-11-16T00:00:00.0',bbox=(-150,-80,150,80), srs='EPSG:4326', format='image/png',size=(300, 250))   
     60    >>> output=wms.getmap(layers=['sea_water_salinity'],time='2982-11-16T00:00:00.0',bbox=(-150,-80,150,80), srs='EPSG:4326', format='image/png',size=(300, 250))   
    5761    >>> f=open('testimage.png', 'wb') 
    5862    >>> f.write(output.read()) 
Note: See TracChangeset for help on using the changeset viewer.