/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/classgen.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/classgen.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/thuban/Thuban/Model/classgen.py revision 1759 by bh, Fri Sep 26 18:36:01 2003 UTC branches/WIP-pyshapelib-bramz/Thuban/Model/classgen.py revision 2734 by bramz, Thu Mar 1 12:42:59 2007 UTC
# Line 1  Line 1 
1  # Copyright (c) 2003 by Intevation GmbH  # -*- encoding: iso-8859-1 -*-
2    #
3    # Copyright (c) 2003-2004 by Intevation GmbH
4  # Authors:  # Authors:
5  # Jonathan Coles <[email protected]>  # Jan-Oliver Wagner <[email protected]> (2004)
6    # Bernhard Herzog <[email protected]> (2003)
7    # Thomas K�ster <[email protected]> (2003)
8    # Jonathan Coles <[email protected]> (2003)
9  #  #
10  # This program is free software under the GPL (>=v2)  # This program is free software under the GPL (>=v2)
11  # Read the file COPYING coming with Thuban for details.  # Read the file COPYING coming with Thuban for details.
# Line 141  def generate_quantiles(_list, percents, Line 146  def generate_quantiles(_list, percents,
146                      max = _list[q]                      max = _list[q]
147    
148                  group = ClassGroupRange(Range((start, min, max, end)), prop)                  group = ClassGroupRange(Range((start, min, max, end)), prop)
149        
150                  group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2),                  group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2),
151                                                  round(p*100, 2)))                                                  round(p*100, 2)))
152                  oldp = p                  oldp = p
# Line 156  def generate_quantiles(_list, percents, Line 161  def generate_quantiles(_list, percents,
161  def calculate_quantiles(_list, percents, _range):  def calculate_quantiles(_list, percents, _range):
162      """Calculate quantiles for the given _list of percents from the      """Calculate quantiles for the given _list of percents from the
163      sorted list of values that are in range.      sorted list of values that are in range.
164                                                                                
165      This may not actually generate len(percents) quantiles if      This may not actually generate len(percents) quantiles if
166      many of the values that fall on quantile borders are the same.      many of the values that fall on quantile borders are the same.
167    
# Line 345  class CustomRamp: Line 350  class CustomRamp:
350              + self.prop1.GetLineWidth()              + self.prop1.GetLineWidth()
351          newProps.SetLineWidth(int(round(w)))          newProps.SetLineWidth(int(round(w)))
352    
353            s = (self.prop2.GetSize() - self.prop1.GetSize()) \
354                * index \
355                + self.prop1.GetSize()
356            newProps.SetSize(int(round(s)))
357    
358          return newProps          return newProps
359    
360      def __SetProperty(self, color1, color2, index, setf):      def __SetProperty(self, color1, color2, index, setf):

Legend:
Removed from v.1759  
changed lines
  Added in v.2734

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26