pyQGIS transform the CRS of a feature

I wanted a method to get a bbox in a different CRS than the object itself
crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84
crsDest = QgsCoordinateReferenceSystem(2193)  # NZGD2000 / NZTM2000
xform = QgsCoordinateTransform(crsSrc, crsDest)
geom=QGSfeature.geometry()
tile_rect=xform.transform(geom.boundingBox())

Leave a Reply

Your email address will not be published. Required fields are marked *


6 + = fifteen