Spaces:
Sleeping
Sleeping
Update ash_animator/basemaps.py
Browse files- ash_animator/basemaps.py +8 -5
ash_animator/basemaps.py
CHANGED
|
@@ -3,11 +3,7 @@ import hashlib
|
|
| 3 |
import tempfile
|
| 4 |
import contextily as ctx
|
| 5 |
from mpl_toolkits.basemap import Basemap
|
| 6 |
-
|
| 7 |
-
import cartopy.feature as cfeature
|
| 8 |
-
import cartopy.io.shapereader as shpreader
|
| 9 |
-
from PIL import Image
|
| 10 |
-
import matplotlib.pyplot as plt
|
| 11 |
|
| 12 |
# Determine platform-appropriate, writable cache directory
|
| 13 |
def get_cache_dir(app_name):
|
|
@@ -35,6 +31,13 @@ os.makedirs(CTX_TILE_CACHE_DIR, exist_ok=True)
|
|
| 35 |
os.makedirs(BASEMAP_TILE_CACHE_DIR, exist_ok=True)
|
| 36 |
os.makedirs(CARTOPY_CACHE_DIR, exist_ok=True)
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
def draw_etopo_basemap(ax, mode="basemap", zoom=11):
|
| 39 |
"""
|
| 40 |
Draws a high-resolution basemap background on the provided Cartopy GeoAxes.
|
|
|
|
| 3 |
import tempfile
|
| 4 |
import contextily as ctx
|
| 5 |
from mpl_toolkits.basemap import Basemap
|
| 6 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Determine platform-appropriate, writable cache directory
|
| 9 |
def get_cache_dir(app_name):
|
|
|
|
| 31 |
os.makedirs(BASEMAP_TILE_CACHE_DIR, exist_ok=True)
|
| 32 |
os.makedirs(CARTOPY_CACHE_DIR, exist_ok=True)
|
| 33 |
|
| 34 |
+
|
| 35 |
+
import cartopy.crs as ccrs
|
| 36 |
+
import cartopy.feature as cfeature
|
| 37 |
+
import cartopy.io.shapereader as shpreader
|
| 38 |
+
from PIL import Image
|
| 39 |
+
import matplotlib.pyplot as plt
|
| 40 |
+
|
| 41 |
def draw_etopo_basemap(ax, mode="basemap", zoom=11):
|
| 42 |
"""
|
| 43 |
Draws a high-resolution basemap background on the provided Cartopy GeoAxes.
|