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

Fix broken Basemap.arcgisimage method #548

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/basemap/src/mpl_toolkits/basemap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4215,7 +4215,7 @@ def warpimage(self,image="bluemarble",scale=None,**kwargs):
return im

def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\
service='ESRI_Imagery_World_2D',xpixels=400,ypixels=None,\
service='World_Imagery',xpixels=400,ypixels=None,\
dpi=96,verbose=False,**kwargs):
"""
Retrieve an image using the ArcGIS Server REST API and display it on
Expand All @@ -4232,7 +4232,7 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\
server web map server URL (default
http://server.arcgisonline.com/ArcGIS).
service service (image type) hosted on server (default
ESRI_Imagery_World_2D, which is NASA 'Blue Marble'
'World_Imagery', which is NASA 'Blue Marble'
image).
xpixels requested number of image pixels in x-direction
(default 400).
Expand Down Expand Up @@ -4284,9 +4284,6 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\
arcgisimage cannot handle images that cross
the dateline for cylindrical projections.""")
raise ValueError(msg)
if self.projection != 'cyl':
xmin = (180./np.pi)*xmin; xmax = (180./np.pi)*xmax
ymin = (180./np.pi)*ymin; ymax = (180./np.pi)*ymax
# ypixels not given, find by scaling xpixels by the map aspect ratio.
if ypixels is None:
ypixels = int(self.aspect*xpixels)
Expand Down