10 ts inspector
In [1]:
Copied!
# !pip install geemap
# !pip install geemap
In [2]:
Copied!
import ee
import geemap
import ee
import geemap
Create an interactive map.
In [3]:
Copied!
Map = geemap.Map(center=[46.9896, -99.7119], zoom=11)
Map
Map = geemap.Map(center=[46.9896, -99.7119], zoom=11)
Map
Out[3]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Set up a user ROI.
In [4]:
Copied!
if Map.user_roi is None:
roi = ee.Geometry.Polygon(
[
[
[-99.924088, 46.87005],
[-99.924088, 47.092566],
[-99.41391, 47.092566],
[-99.41391, 46.87005],
[-99.924088, 46.87005],
]
]
)
else:
roi = Map.user_roi
if Map.user_roi is None:
roi = ee.Geometry.Polygon(
[
[
[-99.924088, 46.87005],
[-99.924088, 47.092566],
[-99.41391, 47.092566],
[-99.41391, 46.87005],
[-99.924088, 46.87005],
]
]
)
else:
roi = Map.user_roi
Create a timeseries ImageCollection.
In [5]:
Copied!
naip_ts = geemap.naip_timeseries(roi=roi, start_year=2009, end_year=2021)
naip_ts = geemap.naip_timeseries(roi=roi, start_year=2009, end_year=2021)
Create a list of layer names to be used in the dropdow menu.
In [6]:
Copied!
dates = naip_ts.aggregate_array('system:time_start')
layer_names = dates.map(lambda x: ee.Date(x).format("YYYY")).getInfo()
layer_names
dates = naip_ts.aggregate_array('system:time_start')
layer_names = dates.map(lambda x: ee.Date(x).format("YYYY")).getInfo()
layer_names
Out[6]:
['2009', '2010', '2012', '2014', '2015', '2016', '2017', '2018', '2019', '2020']
Specify visualization parameters.
In [7]:
Copied!
naip_vis = {'bands': ['N', 'R', 'G']}
naip_vis = {'bands': ['N', 'R', 'G']}
Add the timeseries inspector to the map. Select the dropdown list to choose layers to display on the map.
In [8]:
Copied!
Map.ts_inspector(
left_ts=naip_ts,
right_ts=naip_ts,
left_names=layer_names,
right_names=layer_names,
left_vis=naip_vis,
right_vis=naip_vis,
width='110px',
)
Map
Map.ts_inspector(
left_ts=naip_ts,
right_ts=naip_ts,
left_names=layer_names,
right_names=layer_names,
left_vis=naip_vis,
right_vis=naip_vis,
width='110px',
)
Map
The folium plotting backend does not support this function.
Out[8]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Last update:
2022-03-25