You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
arcgisimage() fails with io.UnsupportedOperation: seek #499
I get exactly the same issue running basemap with windows 10.
I am using basemap 1.2.2 and python 3.8.6
http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/export?bbox=2506055.846693921,4410720.871992808,2506637.203006063,4411028.421318711&bboxSR=3110&imageSR=3110&size=1000,529&dpi=100&format=png32&transparent=true&f=image
Traceback (most recent call last):
File "C:\Machine Learning\Casey Datasets\Balwyn_Map.py", line 12, in
m.arcgisimage(service='World_Street_Map',xpixels=1000,verbose=True,ypixels=None,dpi=100)
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\mpl_toolkits\basemap_init_.py", line 4263, in arcgisimage
return self.imshow(imread(urlopen(basemap_url)),ax=ax,
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\image.py", line 1490, in imread
with img_open(fname) as image:
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFile.py", line 121, in init
self._open()
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\PngImagePlugin.py", line 692, in _open
cid, pos, length = self.png.read()
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\PngImagePlugin.py", line 162, in read
pos = self.fp.tell()
io.UnsupportedOperation: seek
It is a good idea to move to cartopy. But your error message is still saying it is using imread, whereas in my version of the code imread is removed...
Yes, it is now working - or at least not crashing. I am having issues getting the imagery to load up however and will do more investigation with the test codes.
Activity
metonics commentedon Nov 5, 2020
I get exactly the same issue running basemap with windows 10.
I am using basemap 1.2.2 and python 3.8.6
http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/export?bbox=2506055.846693921,4410720.871992808,2506637.203006063,4411028.421318711&bboxSR=3110&imageSR=3110&size=1000,529&dpi=100&format=png32&transparent=true&f=image
Traceback (most recent call last):
File "C:\Machine Learning\Casey Datasets\Balwyn_Map.py", line 12, in
m.arcgisimage(service='World_Street_Map',xpixels=1000,verbose=True,ypixels=None,dpi=100)
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\mpl_toolkits\basemap_init_.py", line 4263, in arcgisimage
return self.imshow(imread(urlopen(basemap_url)),ax=ax,
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\image.py", line 1490, in imread
with img_open(fname) as image:
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFile.py", line 121, in init
self._open()
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\PngImagePlugin.py", line 692, in _open
cid, pos, length = self.png.read()
File "C:\Users\peter\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\PngImagePlugin.py", line 162, in read
pos = self.fp.tell()
io.UnsupportedOperation: seek
I need to solve this issue!
malcolmw commentedon Dec 1, 2020
I have the same issue.
guziy commentedon Dec 1, 2020
This pull request is supposed to fix the problem:
#505
You are welcome to try and test it and maybe there will be more motivation to merge it.
metonics commentedon Dec 2, 2020
guziy commentedon Dec 3, 2020
Yes Peter:
Please test the one in my repo: https://github.com/guziy/basemap/tree/fix_arcgis_image
Just use the fix_arcgis_image branch.
When you checkout the branch try using
You might need to specify the path to geos installation:
Cheers
metonics commentedon Dec 4, 2020
guziy commentedon Dec 4, 2020
Sorry, Peter:
I have no idea about windows, the commands I wrote are for Linux, might work on a mac...
Cheers
metonics commentedon Dec 6, 2020
guziy commentedon Dec 7, 2020
I guess you need to specify the correct branch as they say here. Sorry I just sent you the HTML view link...
https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch
or https
Cheers
metonics commentedon Dec 8, 2020
guziy commentedon Dec 8, 2020
It is a good idea to move to cartopy. But your error message is still saying it is using imread, whereas in my version of the code imread is removed...
c4a19b7#diff-cd2bf9b319d30dd03cdbcd9fd49b22e0735faf3c2797ae78ab60a775d1349d1cR4286
Not sure how you install or use things, but you might still be using some other version of basemap...
PS: please use the GitHub interface for messages, it is hard to follow when your email client copies so many links...
Cheers
metonics commentedon Dec 10, 2020
pip install git+https://github.com/guziy/basemap.git@fix_arcgis_image - eventually worked to install the forked version
Thanks for all your efforts!
Yes, it is now working - or at least not crashing. I am having issues getting the imagery to load up however and will do more investigation with the test codes.
metonics commentedon Dec 11, 2020
this seems to now work correctly. I was having issues with the epsg parameter - If I leave it off the images install fine.
molinav commentedon Dec 23, 2020
I just merged the PR #505 by @guziy into the
masterbranch, this problem should be fixed now.