Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add timeout parameter to add_basemap #216

Open
@anitagraser

Description

I recently discovered that in some setups (for me specifically: WSL in my company VPN), add_basemap gets stuck forever. It seems to fail to load the tiles and there is no way to specify a timeout.

This is my current workaround but it would be much more convenient to just be able to specify timeout=5 in add_basemap:

import signal
class TimeoutError(Exception):
 pass
def timeout_handler(signum, frame):
 raise TimeoutError("Timed out")
ax = gdf().to_crs(3857).plot()
# Set a timer for 5 seconds
try: # SIGALRM is only available on UNIX
 signal.signal(signal.SIGALRM, timeout_handler)
 signal.alarm(5)
except AttributeError:
 pass 
try: # add_basemap gets stuck on WSL when in VPN, therefore
 cx.add_basemap(ax)
except TimeoutError:
 print("Timed out while running add_basemap")
ax.figure.savefig('plot.png')

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

        AltStyle によって変換されたページ (->オリジナル) /