Package sabx10 :: Package osm :: Module consts
[hide private]
[frames] | no frames]

Source Code for Module sabx10.osm.consts

 1  ############################################################################### 
 2  # 
 3  # sabx10 - an SABX file manipulation library 
 4  # Copyright (C) 2009, 2010 Jay Farrimond (jay@sabikerides.com) 
 5  # 
 6  # This file is part of sabx10. 
 7  # 
 8  # sabx10 is free software: you can redistribute it and/or modify it under the 
 9  # terms of the GNU General Public License as published by the Free Software 
10  # Foundation, either version 3 of the License, or (at your option) any later 
11  # version. 
12  # 
13  # sabx10 is distributed in the hope that it will be useful, but WITHOUT ANY 
14  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
15  # A PARTICULAR PURPOSE.  See the GNU General Public License for more details. 
16  # 
17  # You should have received a copy of the GNU General Public License along with 
18  # sabx10.  If not, see <http://www.gnu.org/licenses/>. 
19  # 
20  ############################################################################### 
21  """ 
22  Various constants used in generating PDF maps. 
23   
24  @var PPI: desired points per inch for PNG Maps 
25  @type PPI: C{float} 
26  @var MAPNIK_PPI: points per inch Mapnik uses 
27  @type MAPNIK_PPI: C{float} 
28  @var PIX_SCALE_FACTOR: factor for scaling between Mapnik PPI and our PPI 
29  @type PIX_SCALE_FACTOR: C{float} 
30  @var LETTER_WIDTH: inch width of letter-sized page 
31  @type LETTER_WIDTH: C{float} 
32  @var LETTER_HEIGHT: inch height of letter-sized page 
33  @type LETTER_HEIGHT: C{float} 
34  @var LEGAL_WIDTH: inch width of legal-sized page 
35  @type LEGAL_WIDTH: C{float} 
36  @var LEGAL_HEIGHT: inch height of legal-sized page 
37  @type LEGAL_HEIGHT: C{float} 
38  @var WIDTH: inch width of page size we're using 
39  @type WIDTH: C{float} 
40  @var HEIGHT: inch height of page size we're using 
41  @type HEIGHT: C{float} 
42  """ 
43  from sabx10.map import BORDER 
44   
45  PPI = 200.0 
46  MAPNIK_PPI = 90.7 
47  PIX_SCALE_FACTOR = PPI / MAPNIK_PPI 
48   
49  LETTER_WIDTH = 8.5 
50  LETTER_HEIGHT = 11.0 
51  LEGAL_WIDTH = 8.5 
52  LEGAL_HEIGHT = 14.0 
53   
54  WIDTH = LETTER_WIDTH - (2.0 * BORDER) 
55  HEIGHT = LETTER_HEIGHT - (2.0 * BORDER) 
56