I need to convert EPSG 3857 to EPSG 4326 in a plugin.
#example EPSG 3857
x = 5062443.00656
y = -952576.546977
#convert here to EPSG 4326
#where x2 =41.3387949319,
#where y2 = -8.55714071443
return x2,y2 #return in EPSG 4326
something like the code above. Is there a way to do that?
Best Answer
To convert with Qgis API you need to 2 class
QgsCoordinateReferenceSystem
andQgsCoordianteTransform
here them in action :