Ignore:
Timestamp:
18/03/08 16:39:36 (11 years ago)
Author:
cbyrom
Message:

Add basic GetLegend? webservice to allow lookup of legend graphic when
displaying layers in view tab.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/wmc_util.py

    r3544 r3647  
    6262    return render('conterra_aggregate', format='xml') 
    6363 
    64  
    6564     
    6665def GetWebMapContext(self): 
     
    8281    response.write(filehandle.read()) 
    8382     
     83 
     84def GetLegend(self): 
     85    """ 
     86    Lookup a legend for a WMS map 
     87    """ 
     88    # retrieve context data from the specifiled url 
     89    endpoint = self.inputs['ENDPOINT'] 
     90    if not endpoint: 
     91        raise exceptions.MissingParameterValue, "ENDPOINT parameter required" 
     92    logger.info('Getting Legend from endpoint: ' + endpoint) 
     93 
     94    try: 
     95        filehandle = urllib2.urlopen(endpoint) 
     96    except IOError: 
     97        raise exceptions.URLUnavailable, "Could not access WMC endpoint: %s" % endpoint 
     98         
     99    response.headers['Content-Type'] = 'text/xml' 
     100    response.write(filehandle.read()) 
     101         
Note: See TracChangeset for help on using the changeset viewer.