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

Contents of /branches/WIP-pyshapelib-bramz/Thuban/Model/proj.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations)
Tue Aug 28 15:41:52 2001 UTC (23 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/proj.py
File MIME type: text/x-python
File size: 1164 byte(s)
import all the source files

1 # Copyright (c) 2001 by Intevation GmbH
2 # Authors:
3 # Bernhard Herzog <[email protected]>
4 #
5 # This program is free software under the GPL (>=v2)
6 # Read the file COPYING coming with Thuban for details.
7
8 __version__ = "$Revision$"
9
10 import Projection
11 BaseProjection = Projection.Projection
12 del Projection
13
14 class Projection(BaseProjection):
15
16 """A proj4 projection object that remembers the parameters"""
17
18 def __init__(self, params):
19 BaseProjection.__init__(self, params)
20 self.params = params
21
22 def ForwardBBox(self, bbox):
23 """Return the bounding box of the corners of the bounding box bbox
24 """
25 # This is not really the correct way to determine the bbox of a
26 # projected shape, but for now it works well enough
27 llx, lly, urx, ury = bbox
28 xs = []; ys = []
29 x, y = self.Forward(llx, lly)
30 xs.append(x); ys.append(y)
31 x, y = self.Forward(llx, ury)
32 xs.append(x); ys.append(y)
33 x, y = self.Forward(urx, ury)
34 xs.append(x); ys.append(y)
35 x, y = self.Forward(urx, lly)
36 xs.append(x); ys.append(y)
37 return min(xs), min(ys), max(xs), max(ys)

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26