Skip to content

Commit dc87639

Browse files
committed
fixed bugs with using cachedir in arcgisimage. cachedir is no longer ignored if verbose is false, if a cached image is found now correctly shows it using self.imshow(), now uses os.path.join to join cachedir and filename, so a backslash is no longer required at the end of cachedir
1 parent a3112f1 commit dc87639

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/basemap/src/mpl_toolkits/basemap/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4351,12 +4351,13 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\
43514351
os.makedirs(cachedir)
43524352

43534353
# Check if the image is already in the cachedir folder.
4354-
cache_path = cachedir + filename
4354+
cache_path = os.path.join(cachedir, filename)
43554355

4356-
if os.path.isfile(cache_path) and verbose:
4357-
print('Image already in cache')
4356+
if os.path.isfile(cache_path):
4357+
if verbose:
4358+
print('Image already in cache')
43584359
img = Image.open(cache_path)
4359-
return basemap.imshow(img, ax=ax, origin='upper')
4360+
return self.imshow(img, ax=ax, origin='upper')
43604361

43614362
# Retrieve image from remote server.
43624363
import contextlib

0 commit comments

Comments
 (0)