20 timeseries inspector
Uncomment the following line to install geemap if needed.
# !pip install geemap
import ee
import geemap
geemap.show_youtube('0CZ7Aj8hCyo')
# geemap.update_package()
NAIP: National Agriculture Imagery Program¶
The National Agriculture Imagery Program (NAIP) acquires aerial imagery during the agricultural growing seasons in the continental U.S.
NAIP projects are contracted each year based upon available funding and the FSA imagery acquisition cycle. Beginning in 2003, NAIP was acquired on a 5-year cycle. 2008 was a transition year, and a three-year cycle began in 2009.
NAIP imagery is acquired at a one-meter ground sample distance (GSD) with a horizontal accuracy that matches within six meters of photo-identifiable ground control points, which are used during image inspection.
Older images were collected using 3 bands (Red, Green, and Blue: RGB), but newer imagery is usually collected with an additional near-infrared band (RGBN).
More information about NAIP imagery can be found on Earth Engine Data Catalog.
Create annual composite of NAIP imagery¶
Select 4-band (RGBN) NAIP imagery.
Map = geemap.Map()
naip_ts = geemap.naip_timeseries(start_year=2009, end_year=2018)
Create a list of layer names to be shown under the dropdown list.
layer_names = ['NAIP ' + str(year) for year in range(2009, 2019)]
print(layer_names)
Set visualization parameters.
naip_vis = {'bands': ['N', 'R', 'G']}
Create a split-panel map for visualizing NAIP imagery
Map = geemap.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,
)
Map
Create annual composite of Landsat imagery¶
Use the drawing tools to create an ROI
import ee
import geemap
Map = geemap.Map()
Map
region = Map.draw_last_feature
if region is not None:
roi = region.geometry()
else:
roi = ee.Geometry.Polygon(
[
[
[-115.897448, 35.640766],
[-115.897448, 36.603608],
[-113.784915, 36.603608],
[-113.784915, 35.640766],
[-115.897448, 35.640766],
]
],
None,
False,
)
print(roi.getInfo())
landsat_ts = geemap.landsat_timeseries(
roi=roi, start_year=1984, end_year=2019, start_date='01-01', end_date='12-31'
)
layer_names = ['Landsat ' + str(year) for year in range(1984, 2020)]
print(layer_names)
landsat_vis = {
'min': 0,
'max': 0.3,
'gamma': [1, 1, 1],
'bands': ['NIR', 'Red', 'Green'],
}
Map = geemap.Map()
Map.ts_inspector(
left_ts=landsat_ts,
right_ts=landsat_ts,
left_names=layer_names,
right_names=layer_names,
left_vis=landsat_vis,
right_vis=landsat_vis,
)
Map.centerObject(roi, zoom=8)
Map
Compare Landsat imagery and National Land Cover Database (NLCD)¶
More information about NLCD can be found at the Earth Engine Data Catalog.
import ee
import geemap
Map = geemap.Map()
Map
NLCD = ee.ImageCollection('USGS/NLCD')
NLCD_layers = NLCD.aggregate_array('system:id').getInfo()
print(NLCD_layers)
NLCD2001 = ee.Image('USGS/NLCD/NLCD2001').select('landcover')
NLCD2006 = ee.Image('USGS/NLCD/NLCD2006').select('landcover')
NLCD2011 = ee.Image('USGS/NLCD/NLCD2011').select('landcover')
NLCD2016 = ee.Image('USGS/NLCD/NLCD2016').select('landcover')
NLCD = ee.ImageCollection([NLCD2001, NLCD2006, NLCD2011, NLCD2016])
NLCD_layer_names = ['NLCD ' + str(year) for year in range(2001, 2017, 5)]
print(NLCD_layer_names)
roi = ee.Geometry.Polygon(
[
[
[-115.897448, 35.640766],
[-115.897448, 36.603608],
[-113.784915, 36.603608],
[-113.784915, 35.640766],
[-115.897448, 35.640766],
]
],
None,
False,
)
landsat_ts = geemap.landsat_timeseries(
roi=roi, start_year=2001, end_year=2016, start_date='01-01', end_date='12-31'
)
landsat_layer_names = ['Landsat ' + str(year) for year in range(2001, 2017)]
landsat_vis = {
'min': 0,
'max': 0.3,
'gamma': [1, 1, 1],
'bands': ['NIR', 'Red', 'Green'],
}
nlcd_vis = {'bands': ['landcover']}
Map = geemap.Map()
Map.ts_inspector(
left_ts=landsat_ts,
right_ts=NLCD,
left_names=landsat_layer_names,
right_names=NLCD_layer_names,
left_vis=landsat_vis,
right_vis=nlcd_vis,
)
Map.centerObject(roi, zoom=8)
Map
Created: 2020-04-30