salem.GoogleCenterMap
- class salem.GoogleCenterMap(center_ll=(11.38, 47.26), size_x=640, size_y=640, scale=1, zoom=12, maptype='satellite', use_cache=True, key=None, **kwargs)[source]
Google static map centered on a point.
Needs motionless.
See https://developers.google.com/maps/documentation/maps-static/get-api-key for pricing.
- __init__(center_ll=(11.38, 47.26), size_x=640, size_y=640, scale=1, zoom=12, maptype='satellite', use_cache=True, key=None, **kwargs)[source]
Initialize
- Parameters:
- center_lltuple
tuple of lon, lat center of the map
- size_xint
image size
- size_yint
image size
- scaleint
image scaling factor. 1, 2. 2 is higher resolution but takes longer to download
- zoomint
google zoom level (https://developers.google.com/maps/documentation/ static-maps/intro#Zoomlevels). 1 (world) - 20 (buildings)
- maptypestr, default: ‘satellite’
‘roadmap’, ‘satellite’, ‘hybrid’, ‘terrain’
- use_cachebool, default: True
store the downloaded image in the cache to avoid future downloads
- keystr, default: None
Google API key. If None, it will try to read it from the environment variable STATIC_MAP_API_KEY
- kwargs**
any keyword accepted by motionless.CenterMap
Methods
__init__
([center_ll, size_x, size_y, scale, ...])Initialize
get_vardata
([var_id])Return and subset the image.
set_period
([t0, t1])Set a period of interest for the dataset.
set_roi
([shape, geometry, crs, grid, ...])Set a region of interest for the dataset.
set_subset
([corners, crs, toroi, margin])Set a subset for the dataset.
Attributes
roi
Mask of the ROI (same size as subset).
time
Time array