A map can be generated locally while its coastlines or other reference data still need downloading. If Cartopy cannot find a required resource, the standard Downloader can fetch it before the plot is finished.

That downloader uses Python’s urllib.request.urlopen. For an HTTP forward proxy serving both destination schemes, start the plotting process with an environment such as:

export http_proxy=http://proxy.example:8080
export https_proxy=http://proxy.example:8080

The proxy belongs in the environment inherited by the actual Python process. A notebook kernel or desktop IDE already running may need its own launch configuration. For Jupyter, configure the selected kernel’s startup environment before data acquisition. The HTTPS variable can still contain an HTTP proxy URL. Public reference-data downloads may use an HTTP entry from the HTTP proxy list where that route is permitted and no proxy account is configured.

Look at the requested data URL in the download warning or exception. A missing data resource, a proxy challenge and an HTTPS trust failure occur at different points; changing a projection will not repair the downloader’s network route.

For a machine that should stay offline

Supply the required dataset in advance and point Cartopy at its root:

from pathlib import Path
import cartopy

cartopy.config['pre_existing_data_dir'] = Path('/srv/map-data')

The directory needs the layout expected by the relevant downloader, including the complete dataset files. A folder containing an arbitrary archive is not automatically the resource path Cartopy looks for.

pre_existing_data_dir is checked before data_dir. If the resource is absent from both places, a downloadable item can still trigger acquisition into data_dir, which must be writable. Setting the pre-existing directory is therefore a lookup choice, not a global “never use the network” switch.

Prepare every resolution and feature required by the intended plots. A previously successful coarse map does not establish that a more detailed coastline is already available. Tile services and custom downloaders can have their own retrieval arrangements.

ХӀокхунах тера йаззамаш