I'm trying to plot some data with matplotlib and basemap, but I have trouble making the coordinates match between Google Maps and basemap. For example, I click at a distinctive feature on the map in Google Maps, and read the coordinates (this is on the north east coast of Greenland:
I then try to plot those same coordinates on a map with matplotlib and basemap:
The two points seem to differ by about 10 km. Are there any parameters I can pass to basemap, or any conversions between ellipsoiods or anything I can do to make these points match up?
The python code I used was this:
#!/usr/bin/env pythonimport matplotlibmatplotlib.use('agg')from mpl_toolkits.basemap import Basemapimport mpl_toolkits.basemap.pyproj as pyprojimport matplotlib.pyplot as plt# These are the coordinates I read out from Google Mapslat, lon = 80.615439, -15.474109m = Basemap(width=200000, height=150000, resolution='i', projection='stere', lat_ts=80, lat_0=lat, lon_0=lon)m.fillcontinents(color='#aaaaaa', lake_color='#cccccc')m.drawcountries(linewidth=0.2)m.drawmapboundary(fill_color='#cccccc')X, Y = m(lon, lat)plt.scatter(X, Y, s = 20, color = 'red')plt.savefig('map.png')
أكثر...
I then try to plot those same coordinates on a map with matplotlib and basemap:
The two points seem to differ by about 10 km. Are there any parameters I can pass to basemap, or any conversions between ellipsoiods or anything I can do to make these points match up?
The python code I used was this:
#!/usr/bin/env pythonimport matplotlibmatplotlib.use('agg')from mpl_toolkits.basemap import Basemapimport mpl_toolkits.basemap.pyproj as pyprojimport matplotlib.pyplot as plt# These are the coordinates I read out from Google Mapslat, lon = 80.615439, -15.474109m = Basemap(width=200000, height=150000, resolution='i', projection='stere', lat_ts=80, lat_0=lat, lon_0=lon)m.fillcontinents(color='#aaaaaa', lake_color='#cccccc')m.drawcountries(linewidth=0.2)m.drawmapboundary(fill_color='#cccccc')X, Y = m(lon, lat)plt.scatter(X, Y, s = 20, color = 'red')plt.savefig('map.png')
أكثر...