-
Notifications
You must be signed in to change notification settings - Fork 49
/
03_finding_images.py
35 lines (26 loc) · 1005 Bytes
/
03_finding_images.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import ee
import geemap
# Create a map centered at (lat, lon).
Map = geemap.Map(center=[40, -100], zoom=4)
collection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
point = ee.Geometry.Point(-122.262, 37.8719)
start = ee.Date('2014-06-01')
finish = ee.Date('2014-10-01')
filteredCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1') \
.filterBounds(point) \
.filterDate(start, finish) \
.sort('CLOUD_COVER', True)
first = filteredCollection.first()
# Define visualization parameters in an object literal.
vizParams = {'bands': ['B5', 'B4', 'B3'],
'min': 5000, 'max': 15000, 'gamma': 1.3}
Map.addLayer(first, vizParams, 'Landsat 8 image')
# Load a feature collection.
featureCollection = ee.FeatureCollection('TIGER/2016/States')
# Filter the collection.
filteredFC = featureCollection.filter(ee.Filter.eq('NAME', 'California'))
# Display the collection.
Map.addLayer(ee.Image().paint(filteredFC, 0, 2),
{'palette': 'red'}, 'California')
# Display the map.
Map