Skip to content Skip to sidebar Skip to footer

Cartopy Error When Attempting To Plot Rivers

When attempting to use Cartopy to plot rivers, I'm getting a URL error. I'm not even sure the rivers feature will plot what I want...I'm attempting to get the Galveston Ship Channe

Solution 1:

You can try the url it prints in the warning in a browser, and that'll show that it's simply not available at that location. It is when you change https to http. You could try to download and extract it manually to the location as shown in cartopy.config['data_dir'].

But it's probably best to simply update your cartopy version, since it should be downloading the Natural Earth data from AWS, for example from: https://naturalearth.s3.amazonaws.com/10m_physical/ne_10m_rivers_lake_centerlines.zip

When using cartopy version 0.19 it works fine for me. You do however probably want to change the facecolor to be "none" and only set the edgecolor for the rivers. Since it will otherwise plot the line as if it's a polygon/patch.

ax.add_feature(
    cfeature.NaturalEarthFeature(
        'physical', 'rivers_lake_centerlines', '10m', linewidth=2, 
        edgecolor='lightblue', facecolor='none',
    ),
)

Zooming out a little to show the rivers more clearly, for me it looks like:

enter image description here

Post a Comment for "Cartopy Error When Attempting To Plot Rivers"