I have a problem. I'm currently trying to get the extent of a vector layer in latitude and longitude coordinates in python. The layer is currently in EPSG:3857, so .fullExtent() is not returning what I want. I have tried reprojecting the layer using this:
self.layer= QgsVectorLayer(self.input, self.featureName, "ogr")
self.layer.setCoordinateSystem("crs=epsg:4326")
But the second line introduces a type error when loading the vector layer.
So what would be the best way of getting the bounds in latitude and longitude coordinates? It would be nice if I could get the coordinates from the pyqgis API, but I would be happy if there was another way tool that would do it, such as gdal.