Esempio n. 1
0
    def _getWCSMetadata(self, wcs, layer):
        
        oldProxy = proxyFix(wcs.url)
        try:
            layerMetadata = wcs[layer]
            bboxLimits = ','.join([str(x) for x in layerMetadata.boundingBoxWGS84])
            timepositions = layerMetadata.timepositions
            supportedFormats = layerMetadata.supportedFormats  
            supportedCRS = layerMetadata.supportedCRS          

        finally:
            resetProxy(oldProxy)
        
        return layerMetadata, bboxLimits, timepositions, supportedFormats, supportedCRS
Esempio n. 2
0
 def _getWCSObj(self, endpoint):
     oldProxy = proxyFix(endpoint)
     try:
         
         log.debug("wcs endpoint = %s" % (endpoint,))
         
         getCapabilitiesEndpoint = parseEndpointString(endpoint, 
                     {'Service':'WCS', 'Request':'GetCapabilities'})
         
         log.debug("wcs endpoint = %s" % (getCapabilitiesEndpoint,))
         #requires OWSLib with cookie support
         wcs=WebCoverageService(getCapabilitiesEndpoint, version='1.0.0',cookies= request.headers.get('Cookie', ''))
         
         layers = [x[0] for x in wcs.items()]
     finally:
         resetProxy(oldProxy)
     
     return wcs, layers
Esempio n. 3
0
def _getWCSObj(endpoint):
    """Contructs a WCS object for an endpoint.
    @param endpoint: endpoint URL
    @return WCS object
    """
    oldProxy = proxyFix(endpoint)
    try:

        log.debug("wcs endpoint = %s" % (endpoint,))

        getCapabilitiesEndpoint = parseEndpointString(endpoint, {"Service": "WCS", "Request": "GetCapabilities"})

        log.debug("wcs endpoint = %s" % (getCapabilitiesEndpoint,))
        # requires OWSLib with cookie support
        wcs = WebCoverageService(getCapabilitiesEndpoint, version="1.0.0", cookies=request.headers.get("Cookie", ""))

        layers = [x[0] for x in wcs.items()]
    finally:
        resetProxy(oldProxy)

    return wcs, layers
Esempio n. 4
0
 wcs, layers = self._getWCSObj(endpoint)
 
 log.debug("wcs.url = %s" % (wcs.url,))
 
 assert args['identifier'] in layers
 
 log.debug("args = %s" % (args,))
 
 oldProxy = proxyFix(endpoint)
 try:
     output = wcs.getCoverage(**args)
 except Exception, e:
     log.exception("Exception occurred")
     raise
 finally:
     resetProxy(oldProxy)
 
 log.debug("output = %s" % (output,))
 
 log.debug("output.headers.keys() = %s" % (output.headers.keys(),))
 log.debug("output.geturl() = %s" % (output.geturl(),))
 
 response.headers['Content-Type']=output.headers['Content-Type']
 
 log.debug("output.headers.keys() = %s" % (output.headers.keys(),))
 
 contentDescription = None
 
 for k in output.headers.keys():
     if k.lower() == 'content-disposition':
         contentDescription = output.headers[k]