Comments (1)
Thanks for raising this! The documentation could be more informative indeed.
Are you referring to the fact that the google map doesn't fit exactly the provided extent? If so, I'm afraid there is no simple solution: it is a limitation of the static google maps API which only has a finite number of zoom levels. GoogleVisibleMap
chooses the highest zoom level guaranteed to cover the provided extent.
The simplest workaround (but requiring trial and error) is to play with the size_*
kwarg:
from salem import GoogleVisibleMap, Map
import matplotlib.pyplot as plt
mapextent = [-82, -65, 17, 31] # W, E, S, N
g = GoogleVisibleMap(x=[mapextent[0], mapextent[1]], y=[mapextent[2], mapextent[3]],
scale=2, # this provides a higher resolution ggl image but takes longer to download
size_x=200, size_y=200, # this makes the map smaller starting from its centre
)
ggl_img = g.get_vardata()
fig, ax = plt.subplots(1, 1, figsize=(12,8))
sm = Map(g.grid, factor=1) # factor=1 is nicer here because it prevents image resizing
sm.set_rgb(ggl_img)
sm.visualize(ax=ax)
Another possibility would be to add an "ExactGoogleVisibleMap
" which would do this size_* picking for us. I can consider adding this to salem, but it might not be trivial.
from salem.
Related Issues (20)
- Do not download sample data HOT 4
- Custom .salem_cache location (if any) HOT 4
- Cylindrical Equidistant WRF projection not supported HOT 8
- salem.subset and salem.roi wrong result HOT 4
- [Feature] Add Dask integration HOT 17
- pip install --no-binary fails with salem 0.3.5 HOT 3
- Descartes is in a bad shape
- Can geogrid simulator add 'd01','d02' labels to it? HOT 2
- Simplify descartes vendored code
- Opening multiple wrfout files as a single dataset HOT 1
- Concatenating and ValueError: 'PRCP' is not present in all datasets. HOT 2
- RuntimeError salem.wrf_zlevel HOT 2
- Salem should not fail when `description` attribute is not present
- support relative humidity and dewpoint temperature HOT 1
- Error: Map() takes 0 positional arguments but 1 was given HOT 1
- Iterating through a shapefile in a loop HOT 1
- reproject grid data for rasterio / gdal HOT 3
- Size of subset files too large (`salem.roi`) HOT 3
- Reproject WRF out file to WGS84 to match ERA5 data HOT 10
- Why we need to set dask to single tread? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salem.