Skip to content
Permalink
Browse files

In progress implementation of coordinate transform test

  • Loading branch information
timlinux committed Aug 25, 2012
1 parent 0df9e44 commit 7cc62de08e7594bc9b19fdfad4a2c6790cfba13d
Showing with 5 additions and 6 deletions.
  1. +5 −6 tests/src/python/test_qgscoordinatetransform.py
@@ -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

0 comments on commit 7cc62de

Please sign in to comment.
You can’t perform that action at this time.