1

I am trying to convert QGIS x,y points into the lat, long coordinates. I have (335687.7471962841, 4487822.535352517) supposedly point to somewhere in the Chicago metropolitan area. I tried the accepted answer here (without inits) and got (37.34869549513416 3.0155343399807206) which is somewhere in the Mediterranean Sea. Where am I doing wrong?

Here is what I have done:

from pyproj import Proj, transform

inProj = Proj('epsg:3857')
outProj = Proj('epsg:4326')
x1,y1 = 335687.7471962841,4487822.535352517
x2,y2 = transform(inProj,outProj,x1,y1)
print (x2,y2)

Output:
37.34869549513416 3.0155343399807206
11
  • You could try reprojecting your points layer into EPSG:4326.
    – Jon
    May 25, 2020 at 17:42
  • I think that is what I have already done with the above code, right?
    – tcokyasar
    May 25, 2020 at 17:49
  • Sorry, I am not familiar with any terms of this field.
    – tcokyasar
    May 25, 2020 at 17:50
  • Yes, that's what that code does. Are you sure your original coordinates are in 3857?
    – Jon
    May 25, 2020 at 18:10
  • I have no idea about it. Only thing I know they came from QGIS.
    – tcokyasar
    May 25, 2020 at 18:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.