Changeset 2729 for TI05-delivery


Ignore:
Timestamp:
16/07/07 13:57:27 (12 years ago)
Author:
domlowe
Message:

more on DescribeCoverage? operation

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wcs.py

    r2726 r2729  
    131131        CoverageDescriptions=[] 
    132132        for f in self.features: 
    133           cd=CoverageDescription(identifier=f) 
     133          feature = self.features[f] 
     134          bbox=c.dataset.getBoundingBox()  #TODO, use the bounding box of the feature not the dataset. 
     135          cd=CoverageDescription(identifier=f,titles=feature.name.CONTENT, keywords=None, abstracts=feature.description.CONTENT, boundingBoxes=[BoundingBox([bbox[0],bbox[1]], [bbox[2],bbox[3]], crs='CRS:84')]) 
    134136          CoverageDescriptions.append(cd) 
    135137        return CoverageDescriptions 
     
    151153 
    152154        #get doc from cache or disk: 
    153         rstatus,c.dataset=interface.GetParsedCSML(fileoruri) 
    154         if not rstatus: raise ValueError(c.dataset) 
    155  
    156  
    157         if type(c.dataset) is str: 
    158             #If not a csml datset is some message from exist such as 'access denied' 
    159             return Response(c.dataset) 
    160         return self._renderCapabilities('ows/wcs_capabilities') 
    161  
     155        try: 
     156            rstatus,c.dataset=interface.GetParsedCSML(fileoruri) 
     157            if not rstatus: raise ValueError(c.dataset) 
     158     
     159     
     160            if type(c.dataset) is str: 
     161                #If not a csml datset is some message from exist such as 'access denied' 
     162                return Response(c.dataset) 
     163            return self._renderCapabilities('ows/wcs_capabilities') 
     164        except Exception, e: 
     165            if isinstance(e, OWS_E.OwsError): 
     166               raise e 
     167            elif isinstance(e, ValueError): 
     168                #print e 
     169                #print type(e) 
     170                #print dir(e) 
     171                if e.message == '<p> Access Denied </p><p>Not Logged in</p>': 
     172                    c.msg=e.message 
     173                    #h.redirect_to('/login')   
     174                    return render_response('wcs_accessDenied', mimetype ='text/html') 
     175                else: 
     176                    raise OWS_E.NoApplicableCode(e) 
     177            else: 
     178               raise OWS_E.NoApplicableCode(e) 
    162179    @operation 
    163180    @parameter('Service', possibleValues=['WCS'], required=True) 
     
    178195            self.features[ident]=feature 
    179196        c.covDescs=self._buildCoverageDescriptions() 
    180         print c.covDescs 
    181197        r=render_response('wcs_DescribeCoverageResponse', format='xml') 
    182198        r.headers['content-type'] = 'text/xml' 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ows/wcs_capabilities.kid

    r2711 r2729  
    5555    <ows:Title py:if="ds.titles is not None" py:content="ds.titles"/>         
    5656    <ows:Abstract py:if="ds.abstracts is not None" py:content="ds.abstracts"/>     
    57     <ows:Metadata></ows:Metadata> 
     57    <ows:Keywords> 
     58    </ows:Keywords> 
    5859    <ows:WGS84BoundingBox py:for="bb in ds.boundingBoxes" 
    5960                 minx="${bb.lowerCorner[0]}" 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wcs_DescribeCoverageResponse.kid

    r2726 r2729  
    99../wcsDescribeCoverage.xsd http://www.opengis.net/wcs/1.1/ows 
    1010../owsDataIdentification.xsd"> 
    11 <CoverageDescription py:for="cd in c.covDescs"> 
    12     <Identifier py:content="cd.identifier"/> 
    13 </CoverageDescription> 
     11        <CoverageDescription py:for="cd in c.covDescs"> 
     12        <ows:Title py:if="cd.titles is not None" py:content="cd.titles"/>         
     13        <ows:Abstract py:if="cd.abstracts is not None" py:content="cd.abstracts"/>     
     14        <ows:Keywords py:if = "cd.keywords is not None" > 
     15            <ows:Keyword py:for="key in cd.keywords" py:content="key" />         
     16        </ows:Keywords> 
     17        <Identifier py:content="cd.identifier"/> 
     18        <Domain> 
     19            <SpatialDomain> 
     20                <ows:WGS84BoundingBox py:for="bb in cd.boundingBoxes" crs="${bb.crs}"> 
     21                    <ows:LowerCorner>${bb.lowerCorner[0]}  ${bb.lowerCorner[1]}</ows:LowerCorner> 
     22                    <ows:UpperCorner>${bb.upperCorner[0]}  ${bb.upperCorner[1]}</ows:UpperCorner> 
     23                </ows:WGS84BoundingBox> 
     24                <GridCRS></GridCRS> 
     25            </SpatialDomain> 
     26            <TemporalDomain> 
     27            </TemporalDomain> 
     28        </Domain> 
     29        <Range> 
     30            <Field> 
     31            </Field> 
     32        </Range> 
     33        <SupportedCRS></SupportedCRS> 
     34        <SupportedFormat>application/CF-netcdf</SupportedFormat> 
     35    </CoverageDescription> 
    1436</CoverageDescriptions> 
Note: See TracChangeset for help on using the changeset viewer.