|
7 | 7 |
|
8 | 8 | # Convenience instances in case you may need them |
9 | 9 | # not used in this test |
10 | | -#from utilities import getQgisTestApp |
11 | | -#QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp() |
| 10 | +from utilities import getQgisTestApp |
| 11 | +QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp() |
12 | 12 |
|
13 | 13 | class TestQgsCoordinateTransform(unittest.TestCase): |
14 | 14 |
|
15 | 15 | def testTransformBoundingBox(self): |
| 16 | + """Test that we can transform a rectangular bbox from utm56s to LonLat""" |
16 | 17 | myExtent = QgsRectangle(242270, 6043737, 246330, 6045897) |
17 | 18 | myGeoCrs = QgsCoordinateReferenceSystem() |
18 | 19 | myGeoCrs.createFromId(4326, QgsCoordinateReferenceSystem.EpsgCrsId) |
19 | 20 | myUtmCrs = QgsCoordinateReferenceSystem() |
20 | 21 | myUtmCrs.createFromId(32756, QgsCoordinateReferenceSystem.EpsgCrsId) |
21 | | - myXForm = QgsCoordinateTransform(myGeoCrs, myUtmCrs) |
| 22 | + myXForm = QgsCoordinateTransform(myUtmCrs, myGeoCrs) |
22 | 23 | myProjectedExtent = myXForm.transformBoundingBox(myExtent) |
23 | | - #myProjectedExtent.xMinimum() |
24 | | - #myProjectedExtent.xMaximum() |
25 | 24 | myExpectedExtent = '' |
26 | 25 | myMessage = ('Expected:\n%s\nGot:\n%s\n' % |
27 | 26 | ( myExpectedExtent, |
28 | | - myProjectedExtent.toString()) |
| 27 | + myProjectedExtent.toString())) |
29 | 28 |
|
30 | 29 | assert myExpectedExtent == myProjectedExtent, myMessage |
31 | 30 |
|
|
0 commit comments