/[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

revision 2384 by bh, Fri Sep 26 18:36:01 2003 UTC revision 2385 by jan, Thu Oct 7 14:28:51 2004 UTC
# Line 1  Line 1 
1  # Copyright (c) 2003 by Intevation GmbH  # Copyright (c) 2003-2004 by Intevation GmbH
2  # Authors:  # Authors:
3  # Jonathan Coles <[email protected]>  # Jan-Oliver Wagner <[email protected]> (2004)
4    # Bernhard Herzog <[email protected]> (2003)
5    # Thomas K�ster <[email protected]> (2003)
6    # Jonathan Coles <[email protected]> (2003)
7  #  #
8  # This program is free software under the GPL (>=v2)  # This program is free software under the GPL (>=v2)
9  # 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 144  def generate_quantiles(_list, percents,
144                      max = _list[q]                      max = _list[q]
145    
146                  group = ClassGroupRange(Range((start, min, max, end)), prop)                  group = ClassGroupRange(Range((start, min, max, end)), prop)
147        
148                  group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2),                  group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2),
149                                                  round(p*100, 2)))                                                  round(p*100, 2)))
150                  oldp = p                  oldp = p
# Line 156  def generate_quantiles(_list, percents, Line 159  def generate_quantiles(_list, percents,
159  def calculate_quantiles(_list, percents, _range):  def calculate_quantiles(_list, percents, _range):
160      """Calculate quantiles for the given _list of percents from the      """Calculate quantiles for the given _list of percents from the
161      sorted list of values that are in range.      sorted list of values that are in range.
162                                                                                
163      This may not actually generate len(percents) quantiles if      This may not actually generate len(percents) quantiles if
164      many of the values that fall on quantile borders are the same.      many of the values that fall on quantile borders are the same.
165    
# Line 345  class CustomRamp: Line 348  class CustomRamp:
348              + self.prop1.GetLineWidth()              + self.prop1.GetLineWidth()
349          newProps.SetLineWidth(int(round(w)))          newProps.SetLineWidth(int(round(w)))
350    
351            s = (self.prop2.GetSize() - self.prop1.GetSize()) \
352                * index \
353                + self.prop1.GetSize()
354            newProps.SetSize(int(round(s)))
355    
356          return newProps          return newProps
357    
358      def __SetProperty(self, color1, color2, index, setf):      def __SetProperty(self, color1, color2, index, setf):

Legend:
Removed from v.2384  
changed lines
  Added in v.2385

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26