Netcdf
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install geemap
# !pip install geemap
In [ ]:
Copied!
import os
import geemap
import xarray as xr
from ipyleaflet import basemaps
from ipyleaflet.velocity import Velocity
import os
import geemap
import xarray as xr
from ipyleaflet import basemaps
from ipyleaflet.velocity import Velocity
In [ ]:
Copied!
Map = geemap.Map(center=[44.33, -130.60], zoom=3, interpolation='nearest')
Map.add_layer(basemaps.CartoDB.DarkMatter)
Map
Map = geemap.Map(center=[44.33, -130.60], zoom=3, interpolation='nearest')
Map.add_layer(basemaps.CartoDB.DarkMatter)
Map
In [ ]:
Copied!
file_path = os.path.abspath('wind-global.nc')
if not os.path.exists(file_path):
url = 'https://github.com/giswqs/geemap/raw/master/examples/data/wind-global.nc'
geemap.download_file(url)
file_path = os.path.abspath('wind-global.nc')
if not os.path.exists(file_path):
url = 'https://github.com/giswqs/geemap/raw/master/examples/data/wind-global.nc'
geemap.download_file(url)
In [ ]:
Copied!
ds = xr.open_dataset(file_path)
ds
ds = xr.open_dataset(file_path)
ds
In [ ]:
Copied!
display_options = {
'velocityType': 'Global Wind',
'displayPosition': 'bottomleft',
'displayEmptyString': 'No wind data',
}
wind = Velocity(
data=ds,
name='Velocity',
zonal_speed='u_wind',
meridional_speed='v_wind',
latitude_dimension='lat',
longitude_dimension='lon',
velocity_scale=0.01,
max_velocity=20,
display_options=display_options,
)
Map.add_layer(wind)
display_options = {
'velocityType': 'Global Wind',
'displayPosition': 'bottomleft',
'displayEmptyString': 'No wind data',
}
wind = Velocity(
data=ds,
name='Velocity',
zonal_speed='u_wind',
meridional_speed='v_wind',
latitude_dimension='lat',
longitude_dimension='lon',
velocity_scale=0.01,
max_velocity=20,
display_options=display_options,
)
Map.add_layer(wind)
Last update:
2022-06-27