-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16ab58f
commit 3452263
Showing
4 changed files
with
136 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
from raster import * | ||
from raster_factory import * | ||
from vector import * | ||
from affine import * | ||
|
||
__version__ = '0.2.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
|
||
class Affine(object): | ||
# any global variables here | ||
def __init__(self, a, b, c, d, e, f): | ||
self.a = a | ||
self.b = b | ||
self.c = c | ||
self.d = d | ||
self.e = e | ||
self.f = f | ||
|
||
def __repr__(self): | ||
rep = "\n| %f %f %f |" % (self.a, self.b, self.c) | ||
rep += "\n| %f %f %f |\n" % (self.d, self.e, self.f) | ||
return rep | ||
|
||
def __eq__(self, other): | ||
a = (self.a == other.a) | ||
b = (self.b == other.b) | ||
c = (self.c == other.c) | ||
d = (self.d == other.d) | ||
e = (self.e == other.e) | ||
f = (self.f == other.f) | ||
if all([a, b, c, d, e, f]): | ||
return True | ||
else: | ||
return False | ||
|
||
@classmethod | ||
def identity(): | ||
return Affine(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | ||
|
||
@ classmethod | ||
def from_gdal(self, c, a, b, f, d, e): | ||
return Affine(a, b, c, d, e, f) | ||
|
||
def to_gdal(self): | ||
return (self.c, self.a, self.b, self.f, self.d, self.e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.