90 naip timelapse
Uncomment the following line to install geemap if needed.
In [1]:
Copied!
# !pip install geemap
# !pip install geemap
In [2]:
Copied!
import ee
import geemap
import ee
import geemap
If run into errors, uncomment the following line to update the package and restart the kernel to take effect.
In [3]:
Copied!
# geemap.update_package()
# geemap.update_package()
In [4]:
Copied!
Map = geemap.Map()
Map
Map = geemap.Map()
Map
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Create a region of interest.
In [5]:
Copied!
region = ee.Geometry.Polygon(
[
[
[-99.101934, 47.12745],
[-99.101934, 47.156232],
[-99.033441, 47.156232],
[-99.033441, 47.12745],
[-99.101934, 47.12745],
]
]
)
region = ee.Geometry.Polygon(
[
[
[-99.101934, 47.12745],
[-99.101934, 47.156232],
[-99.033441, 47.156232],
[-99.033441, 47.12745],
[-99.101934, 47.12745],
]
]
)
In [6]:
Copied!
Map.addLayer(region)
Map.centerObject(region)
Map.addLayer(region)
Map.centerObject(region)
Create a timeseries
In [7]:
Copied!
collection = geemap.naip_timeseries(region, RGBN=True)
collection = geemap.naip_timeseries(region, RGBN=True)
In [8]:
Copied!
images = collection.toList(collection.size())
images = collection.toList(collection.size())
Get image dates
In [9]:
Copied!
dates = geemap.image_dates(collection).getInfo()
dates = geemap.image_dates(collection).getInfo()
In [10]:
Copied!
size = images.size().getInfo()
size = images.size().getInfo()
Add images to the map
In [11]:
Copied!
for i in range(size):
image = ee.Image(images.get(i))
Map.addLayer(image, {'bands': ['N', 'R', 'G']}, dates[i][:4])
for i in range(size):
image = ee.Image(images.get(i))
Map.addLayer(image, {'bands': ['N', 'R', 'G']}, dates[i][:4])
Create s timelapse
In [12]:
Copied!
geemap.naip_timelapse(
region, out_gif="naip.gif", bands=['N', 'R', 'G'], frames_per_second=3, mp4=True
)
geemap.naip_timelapse(
region, out_gif="naip.gif", bands=['N', 'R', 'G'], frames_per_second=3, mp4=True
)
Generating URL... Downloading GIF image from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/videoThumbnails/fbba2621a171eb779872532b02c30d82-c792c891ab4af4d40bd1c69398ba49fb:getPixels Please wait ... The GIF image has been saved to: /home/runner/work/geospatial-notebooks/geospatial-notebooks/docs/geemap/naip.gif ffmpeg is not installed on your computer. ffmpeg is not installed on your computer.
Out[12]:
'/home/runner/work/geospatial-notebooks/geospatial-notebooks/docs/geemap/naip.gif'
Last update:
2022-03-14