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
tcokyasar
  • 121
  • 3
  • You could try reprojecting your points layer into EPSG:4326. – Jon May 25 '20 at 17:42
  • I think that is what I have already done with the above code, right? – tcokyasar May 25 '20 at 17:49
  • Sorry, I am not familiar with any terms of this field. – tcokyasar May 25 '20 at 17:50
  • Yes, that's what that code does. Are you sure your original coordinates are in 3857? – Jon May 25 '20 at 18:10
  • I have no idea about it. Only thing I know they came from QGIS. – tcokyasar May 25 '20 at 18:10
  • The code is correct: your input coordinates are not in Chicago, but in the Mediterranean. – Thibauld Croonenborghs May 25 '20 at 18:26
  • @ThibauldCroonenborghs True, but only if his original CRS is EPSG:3857. I'm guessing he's assuming the wrong CRS for his coordinates. – Jon May 25 '20 at 18:30
  • @user8028576 In QGIS, start a new project. Drag your points file into that project (or add them). Double-click on them in the "Layers" panel. Click on the "information" tab. Find "CRS" and report what you see there. – Jon May 25 '20 at 18:33
  • The coordinates you have probably are UTM coordinates. I guess NAD83 / UTM Zone 16N (EPSG:26916) – Noura May 25 '20 at 18:44
  • Tried EPSG 26716 & 26916 but didn't answer. The coordinates are quite far from Chicago (around 200km), more or less in Bloomington – ThomasG77 May 25 '20 at 19:23
  • Bloomington is the correct location. Just double-checked with my friend and learned that it was the Bloomington data. Thanks for all the effort. – tcokyasar May 25 '20 at 19:43

0 Answers0