Is it possible to define a projection for QgsPointXY()

coordinate systempyqgispythonqgis

I am creating a QgsRectangle like this:

llc = QgsPointXY(319660,4624088)       # lower left corner in UTM
urc = QgsPointXY(396425,4742843)       # upper right corner in UTM
aoi = QgsRectangle(llc,urc)

But how do I tell him the correct crs of these points? Can I pass the EPSG somehow?

Best Answer

No. You cannot pass an EPSG to QgsPointXY. None of the constructor methods of it allows to define a CRS. Also, you cannot set a CRS after creating a point.

In addition, a CRS cannot be defined for QgsGeometry and QgsFeature, too.

Related Question