Skip to content

Arcgisimage fails #242

Closed
Closed
@bjacotg

Description

@bjacotg

I tried a simple map and add some arcgisimage, but it failed.

Here is the code:

m=Basemap(projection='cyl',llcrnrlon=-90,llcrnrlat=30,urcrnrlon=-60,urcrnrlat=60)
m.arcgisimage(verbose=True)
plt.show()

And the error:

Traceback (most recent call last):
  File "/home/bastien/PycharmProjects/untitled/rider_analysis.py", line 55, in <module>
    m.arcgisimage(verbose=True)
  File "/usr/lib/python3.5/site-packages/mpl_toolkits/basemap/__init__.py", line 4270, in arcgisimage
    return self.imshow(imread(urllib.request.urlopen(basemap_url)),origin='upper')
  File "/usr/lib/python3.5/site-packages/matplotlib/image.py", line 1326, in imread
    return handler(fname)
SystemError: <built-in function read_png> returned NULL without setting an error

Process finished with exit code 1

After debugging around, I found that imread does not like http.request.HttpResponse, but works fine with file path.

Regards,

Bastien

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions