Search code examples
cartopy

Direct Cartopy feature request to local directories instead of geoserver


If you download the data from: https://www.naturalearthdata.com/ then is there an option in cartopy.feature adds to check a local directory first before going to the webserver.

I think under windows there is some caching going on in appdata but could not find documentation to provide a path for this feature to look for the data in a directory. Nor how this would be standardized across OS. This could be applied to the feature request in this cartopy example:

https://scitools.org.uk/cartopy/docs/latest/gallery/lines_and_polygons/feature_creation.html#sphx-glr-gallery-lines-and-polygons-feature-creation-py

snippets:

import cartopy.feature as cfeature
# Create a feature for States/Admin 1 regions at 1:50m from Natural Earth
states_provinces = cfeature.NaturalEarthFeature(
    category='cultural',
    name='admin_1_states_provinces_lines',
    scale='50m',
    facecolor='none')

Solution

  • As indicated by swatchai in the comment there is a config class that handles this with fall back to download. https://scitools.org.uk/cartopy/docs/v0.15/cartopy.html