Changeset 6517


Ignore:
Timestamp:
09/02/10 11:36:23 (9 years ago)
Author:
pnorton
Message:

First attempt at extending the make figure code to include metadata and legends.

Location:
cowsclient/trunk
Files:
12 added
3 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/controllers/wmsviz.py

    r6332 r6517  
    3939        'image/tiff': 'TIFF' 
    4040    } 
     41     
     42    indexTemplate = 'wmsviz' 
    4143     
    4244    def index(self): 
     
    119121        log.debug("finished wmsviz controller index action") 
    120122         
    121         return render('wmsviz') 
     123        return render(self.indexTemplate) 
    122124 
    123125    def _buildInitialSetup(self, endpointParam): 
  • cowsclient/trunk/cowsclient/lib/build_figure.py

    r5821 r6517  
    1111from cowsclient.lib.base import request 
    1212from cowsclient.lib.png_combine import merge 
     13 
     14from cowsclient.lib.figure_builder import FigureBuilder 
    1315 
    1416from cStringIO import StringIO 
     
    4850     
    4951    if mplAvailable: 
    50         finalImg = addAxisToImage(defaults, params) 
     52        finalImg, points = addAxisToImage(defaults, params) 
     53         
     54        fb = FigureBuilder(params) 
     55        finalImg  = fb.buildImage(finalImg, points) 
     56     
    5157    else: 
    5258        finalImg = buildImage(defaults, params) 
     
    131137    # create an empty image with the axes drawn 
    132138    fig = Figure(figsize=figsize, dpi=dpi, facecolor=facecolor, frameon=(not transparent)) 
    133     axes = fig.add_axes([0.1, 0.1, 0.8, 0.8],  frameon=True) 
     139    axes = fig.add_axes([0.05, 0.05, 0.9, 0.9],  frameon=True) 
    134140 
    135141    log.debug("axes.get_position() = %s" % (axes.get_position(),)) 
     
    169175    log.debug("defaults['HEIGHT'] = %s" % (defaults['HEIGHT'],)) 
    170176 
     177 
     178     
    171179    #request the new GetMap images 
    172180    img = buildImage(defaults, params) 
     181     
     182    log.debug("im.size = %s, img.size = %s, box = %s" % (im.size, img.size, box,)) 
    173183 
    174184    #paste them inside the axis 
     
    176186 
    177187     
    178     return im 
     188    return im, box 
    179189 
  • cowsclient/trunk/development.ini

    r6119 r6517  
    2323beaker.session.secret = somesecret 
    2424serverurl=http://localhost:5005 
     25image_folder = %(here)s/cowsclient/public/layout/images 
    2526 
    2627# select a custom openlayers path, cc_openlayers is the cows client reduced version 
Note: See TracChangeset for help on using the changeset viewer.