Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No background map from arcgisimage #481

Closed
tonino0013 opened this issue Dec 27, 2019 · 7 comments
Closed

No background map from arcgisimage #481

tonino0013 opened this issue Dec 27, 2019 · 7 comments

Comments

@tonino0013
Copy link

Dear All,
I am working with Python3.5.2 with matplotlib '3.0.3' version, my basemap version is the 1.1.0. I have an Ubuntu 16.04 Laptop.
I have this code (to plot a seismic epicenter over the background map from arcgisimage server):

m = Basemap(projection='mill', llcrnrlon=-70.20, llcrnrlat=-30.00, urcrnrlon=-56.90, urcrnrlat=-9.10,
            resolution='c',epsg= 4326, ax=ax1)
m.arcgisimage(service='World_Topo_Map', xpixels = 2000, verbose= False)
m.drawcoastlines()
m.drawcountries(color='yellow',linewidth=2.7)
m.drawmeridians(np.arange(0, 360, 2.5), labels=[True,False,False,True])
m.drawparallels(np.arange(-90, 90, 2.5),labels=[False,True,True,False])

with open(epi) as f:
    reader=csv.reader(f, delimiter=';')
    next(reader)
    for uhu in reader:
        lat.append(float(uhu[0]))
        lon.append(float(uhu[1]))
        mag.append(float(uhu[2]))
        depth.append(float(uhu[3]))

min_marker_size = 1.7
for lons, lats, mags in zip(lon, lat, mag):
    x,y = m(lons, lats)
    msize = mags * min_marker_size
    m.plot(x, y, 'ro', markersize=msize)

plt.show()

Under Windows 10 this code works nice and I can see the wonderful background map, however at Linux O.S. I am not able to see the background map, is this an issue of matplotlib or basemap?.

The first figure is taken from Win10, the second figure is taken from Ubuntu16.04

Regards,

basemap_Windows10

basamap_Ubuntu

@WeatherGod
Copy link
Member

WeatherGod commented Dec 28, 2019 via email

@tonino0013
Copy link
Author

Dear @WeatherGod ,

I saw just a warning updating the 'verbose=True'

FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method.
  return _prepare_from_string(" ".join(pjargs))
http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export?bbox=-4022.163721818379,-1718.8733853924696,-3260.129854294384,-521.3915935690491&bboxSR=4326&imageSR=4326&size=2000,3142&dpi=96&format=png32&transparent=true&f=image

The link under my Ubuntu 16.04 it is just an empty image
Thank you for your time.
Tonino

@FMassin
Copy link
Contributor

FMassin commented Jul 20, 2020

I have the same issue on Mac OSX...

@vc1492a
Copy link

vc1492a commented Feb 14, 2021

Same here, on macOS 10.15.7 (Catalina) Python 3.8 Matplotlib version 3.2.1.

@molinav
Copy link
Member

molinav commented Feb 14, 2021

@vc1492a I think this issue could be the same one as in #499 and the current master already includes the bugfix. Which basemap version are you using?

@vc1492a
Copy link

vc1492a commented Feb 16, 2021

@molinav thanks for the prompt reply - after some more diagnosis ended up being an unrelated issue, thanks!

@molinav
Copy link
Member

molinav commented Aug 10, 2022

I am closing this issue because the problem in the OP is actually solved now. The key point is the traceback of the URL:

http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export?bbox=-4022.163721818379,-1718.8733853924696,-3260.129854294384,-521.3915935690491&bboxSR=4326&imageSR=4326&size=2000,3142&dpi=96&format=png32&transparent=true&f=image

where the bounding box should contain "standard" latitudes and longitudes (since the OP uses EPSG 4326), but instead it contains out-of-bound values due to an unexpected radian-to-degree conversion factor applied inside Basemap.arcgisimage before generating the URL.

This problem was fixed in PR #505 by @guziy, but this PR introduced a new bug in any projection different from "cyl". This new bug was finally fixed in PR #548 and released with basemap version 1.3.4.

@molinav molinav closed this as completed Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants