Ignore:
Timestamp:
05/08/08 11:32:03 (11 years ago)
Author:
spascoe
Message:

GetFeatureInfo? bug fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/wms_controller.py

    r4078 r4101  
    416416                                        'version') 
    417417 
    418         # Coordinate parameters 
     418        # Coordinate parameters 
    419419        bbox = tuple(float(x) for x in self.getOwsParam('bbox').split(',')) 
    420420        width = int(self.getOwsParam('width')) 
    421421        height = int(self.getOwsParam('height')) 
    422422           
    423         # Get pixel location 
     423        # Get pixel location 
    424424        i = int(self.getOwsParam('i')) 
    425425        j = int(self.getOwsParam('j')) 
     
    427427        # Translate to geo-coordinates 
    428428        x, y = bbox_util.pixelToGeo(i, j, bbox, width, height) 
    429         #start preparing GetFeatureInfo response. Assumes "HTML" output format 
    430  
    431         htmlResponse = "<html><body><p> <b>Feature Information about pixel position: "+self.getOwsParam('i')+","+self.getOwsParam('j')+"/geo position: "+str(x)+","+str(y) +"<b/></p>" 
     429        #start preparing GetFeatureInfo response. Assumes "HTML" output format 
     430 
     431        htmlResponse = "<html><body><p> <b>Feature Information about pixel position: "+self.getOwsParam('i')+","+self.getOwsParam('j')+"/geo position: "+str(x)+","+str(y) +"<b/></p>" 
    432432         
    433433         
    434434        layers = self._getLayerParam('query_layers') 
    435         #Adjusts response for multiple layers 
     435        #Adjusts response for multiple layers 
    436436        if len(layers) > 1: 
    437437            htmlResponse = htmlResponse+" Multiple possible features found as follows:" 
     
    439439        htmlResponse = htmlResponse+"<ul>" 
    440440         
    441         format = self.getOwsParam('info_format') 
     441        format = self.getOwsParam('info_format', default='text/html') 
    442442        for layerName, layerObj in layers.iteritems(): 
    443443            print format 
     
    447447                raise InvalidParameterValue('Layer %s does not support GetFeatureInfo in format %s' %(layerName, format), 'info_format') 
    448448 
    449         
    450  
    451449            if version == '1.1.1': 
    452450                srs = self.getOwsParam('srs') 
Note: See TracChangeset for help on using the changeset viewer.