Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to tell cartopy to use offline shapefiles #42

Merged
merged 2 commits into from
Sep 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion trollsched/drawing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2018 Adam.Dybbroe
# Copyright (c) 2018, 2019 Adam.Dybbroe

# Author(s):

Expand Down Expand Up @@ -40,6 +40,11 @@
logger.warning("Failed loading Cartopy, will try Basemap instead")
BASEMAP_NOT_CARTOPY = True

if not BASEMAP_NOT_CARTOPY:
import cartopy
cartopy.config['pre_existing_data_dir'] = os.environ.get(
"CARTOPY_PRE_EXISTING_DATA_DIR", cartopy.config['pre_existing_data_dir'])


class MapperBasemap(object):
"""A class to generate nice plots with basemap.
Expand Down