Return True if the envelopes are equivalent; can compare against other Envelopes and 4-tuples.
(self, other)
| 71 | raise GDALException("Envelope minimum Y > maximum Y.") |
| 72 | |
| 73 | def __eq__(self, other): |
| 74 | """ |
| 75 | Return True if the envelopes are equivalent; can compare against |
| 76 | other Envelopes and 4-tuples. |
| 77 | """ |
| 78 | if isinstance(other, Envelope): |
| 79 | return ( |
| 80 | (self.min_x == other.min_x) |
| 81 | and (self.min_y == other.min_y) |
| 82 | and (self.max_x == other.max_x) |
| 83 | and (self.max_y == other.max_y) |
| 84 | ) |
| 85 | elif isinstance(other, tuple) and len(other) == 4: |
| 86 | return ( |
| 87 | (self.min_x == other[0]) |
| 88 | and (self.min_y == other[1]) |
| 89 | and (self.max_x == other[2]) |
| 90 | and (self.max_y == other[3]) |
| 91 | ) |
| 92 | else: |
| 93 | raise GDALException("Equivalence testing only works with other Envelopes.") |
| 94 | |
| 95 | def __str__(self): |
| 96 | "Return a string representation of the tuple." |
nothing calls this directly
no test coverage detected