Skip to content

Commit

Permalink
In progress implementation of coordinate transform test
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Aug 25, 2012
1 parent 0df9e44 commit 7cc62de
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/src/python/test_qgscoordinatetransform.py
Expand Up @@ -7,25 +7,24 @@

# Convenience instances in case you may need them
# not used in this test
#from utilities import getQgisTestApp
#QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()
from utilities import getQgisTestApp
QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()

class TestQgsCoordinateTransform(unittest.TestCase):

def testTransformBoundingBox(self):
"""Test that we can transform a rectangular bbox from utm56s to LonLat"""
myExtent = QgsRectangle(242270, 6043737, 246330, 6045897)
myGeoCrs = QgsCoordinateReferenceSystem()
myGeoCrs.createFromId(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
myUtmCrs = QgsCoordinateReferenceSystem()
myUtmCrs.createFromId(32756, QgsCoordinateReferenceSystem.EpsgCrsId)
myXForm = QgsCoordinateTransform(myGeoCrs, myUtmCrs)
myXForm = QgsCoordinateTransform(myUtmCrs, myGeoCrs)
myProjectedExtent = myXForm.transformBoundingBox(myExtent)
#myProjectedExtent.xMinimum()
#myProjectedExtent.xMaximum()
myExpectedExtent = ''
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
( myExpectedExtent,
myProjectedExtent.toString())
myProjectedExtent.toString()))

assert myExpectedExtent == myProjectedExtent, myMessage

Expand Down

0 comments on commit 7cc62de

Please sign in to comment.