-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVideos_indices_vegetacion_Cabuyaro_Planet.js
215 lines (190 loc) · 9.91 KB
/
Videos_indices_vegetacion_Cabuyaro_Planet.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
var geometry =
/* color: #d63000 */
/* shown: false */
ee.Geometry.Polygon(
[[[-72.83131382235845, 4.3909269466189915],
[-72.82947920310157, 4.395339576565946],
[-72.82788059648794, 4.3998377796179415],
[-72.82684525090103, 4.402322217207816],
[-72.82645632167021, 4.403286308636893],
[-72.82636914490611, 4.40385393144579],
[-72.82617467940769, 4.404828045400769],
[-72.82717246098731, 4.404560617948143],
[-72.82818633551793, 4.404277143386955],
[-72.82896417582074, 4.405191748151025],
[-72.8284170065776, 4.406389826009799],
[-72.82744068162918, 4.407545114612819],
[-72.82658237504066, 4.407395354442528],
[-72.8266682050641, 4.408047877252472],
[-72.82649654366232, 4.4086736573306835],
[-72.8274406816318, 4.409598955616436],
[-72.8281487840952, 4.410433327067396],
[-72.82889980284097, 4.411374667804088],
[-72.82937187110115, 4.412134157754776],
[-72.83012288974743, 4.4130220113788425],
[-72.83047694074644, 4.413535468820054],
[-72.83093291623949, 4.413770803262261],
[-72.83190387589408, 4.41370662058319],
[-72.83276218337936, 4.413214557685144],
[-72.83339518444994, 4.4127117975196],
[-72.83381360808244, 4.4121234607427136],
[-72.83465045697379, 4.411481638208421],
[-72.83533710224302, 4.40959895560892],
[-72.8356804254634, 4.40857203593713],
[-72.83591645951968, 4.407908816276492],
[-72.8365065449833, 4.407940907543027],
[-72.83733266509861, 4.407759056584899],
[-72.83791738619655, 4.407593251955651],
[-72.83850210740411, 4.407898119351777],
[-72.83907073591227, 4.408336699808889],
[-72.83937114290694, 4.408818068541337],
[-72.8396286348106, 4.409235254815417],
[-72.84001487294715, 4.409588258357028],
[-72.84022944967647, 4.410117763342956],
[-72.8401650768333, 4.410775632862449],
[-72.8404225687879, 4.412316007389793],
[-72.84090536677846, 4.412326703943655],
[-72.84155446171545, 4.412460416807013],
[-72.84134256780996, 4.413404429801177],
[-72.84072163620176, 4.413940618149834],
[-72.84059423018029, 4.414754927330519],
[-72.84054058666916, 4.415728354043344],
[-72.84052985725533, 4.41650923317814],
[-72.84063714627932, 4.417161748420583],
[-72.8409482824643, 4.417594975703258],
[-72.84063178166822, 4.418025528602496],
[-72.8406237346674, 4.418583107088922],
[-72.84040111124183, 4.419012320957021],
[-72.84048694175213, 4.419525773764666],
[-72.84104484107503, 4.4200606200918795],
[-72.84171002716568, 4.4206061618620485],
[-72.84204262122911, 4.4213923844844585],
[-72.84210163026002, 4.42219197794941],
[-72.84254687759966, 4.423226902519223],
[-72.855764799035, 4.4012337969015904],
[-72.85578625681555, 4.399928736911972],
[-72.85574334137084, 4.398559493518869],
[-72.85580771437299, 4.396034942369099],
[-72.85585063027946, 4.394751268576372],
[-72.85617249513176, 4.394195009726963],
[-72.85626905438222, 4.39370293408197],
[-72.85668747863112, 4.393531777220826],
[-72.85742776846914, 4.393221555163498],
[-72.85780327723577, 4.392141126372383],
[-72.858119778001, 4.391616956672743],
[-72.85826461706985, 4.39096441889961],
[-72.85836654081696, 4.390311881036699],
[-72.85846846487279, 4.3899802636721565],
[-72.8584899228438, 4.389445395327595],
[-72.85846846507566, 4.388974710986999],
[-72.85844700719929, 4.388504026710804],
[-72.85838263417926, 4.387904973780211],
[-72.85827534556641, 4.387027787295628],
[-72.85827534587776, 4.3862361798027],
[-72.85793202320578, 4.383925535835018],
[-72.85772817526339, 4.38340136043434],
[-72.85763161565973, 4.382877185033602],
[-72.85730975093037, 4.381828834192973],
[-72.85726683560341, 4.379475386571453],
[-72.85782473488877, 4.377934944119561],
[-72.85788910761931, 4.376822400024019],
[-72.85752432758404, 4.376223337675301],
[-72.85703080079736, 4.375560089143086],
[-72.85630124069398, 4.374918235130912],
[-72.85588281594225, 4.374447542039634],
[-72.85503523847359, 4.374233590263058],
[-72.85398381285363, 4.3738163852837735],
[-72.85318987930437, 4.373591735130669],
[-72.85243886087811, 4.373773594615669],
[-72.85147326612332, 4.373313597735325],
[-72.85082953618134, 4.371601980728763],
[-72.85097973926695, 4.370489427522611],
[-72.8507544338784, 4.3700615220474734],
[-72.85022872156878, 4.369719197506667],
[-72.84928458345215, 4.36912013001256],
[-72.84879105716949, 4.368339200650602],
[-72.84782546311486, 4.368242920990585],
[-72.84746068330169, 4.369002455781846],
[-72.84676330885986, 4.369275246177067],
[-72.84607129873852, 4.369047920614247],
[-72.84555095064877, 4.368392688305174],
[-72.84254687758076, 4.372800113041608],
[-72.8392853125377, 4.377079141379587],
[-72.83306258976528, 4.386514312395148]]]);
/*Para correr el cogigo se debe tener registrada una cuenta en la plataforma de acceso a las imagenes
de Planet en la siguiente direccion https://www.planet.com/nicfi/ y habilitar la opcion para acceder a la
base de la coleccion de imagenes de NICFI-Planet desde Google Earth Engine, registrando la cuenta de correo
de gmail que se tiene registrada para acceder a GEE*/
/*El siguiente script crea visualizaciones en video con los cambios en el terreno y en los indices NDVI,
SAVI, ARVI, EVI, GCI, GCI que se presentan en una coleccion de imagenes multiespectrales PLANET de 4,7 m
de resolucion en un poligono creado por geometria que es un area de cultivo en Cabuyaro Meta*/
/*Traer la coleccion de imagenes PLANET con un filtro de fechas, un filtro con los parametros de
visualizacion en RGB y recortadas al area del poligono para cada una de las imagenes de la coleccion
al final se imprime la coleccion para saber cuantas imagnes tiene y la visualiza en el mapa*/
var nicfi = ee.ImageCollection('projects/planet-nicfi/assets/basemaps/americas');
var coleccion = nicfi.filter(ee.Filter.date('2021-12-01','2023-12-30'))
.map(function(i){return i.select(['B','G','R','N']).clip(geometry)})
print(coleccion)
var visparam = {bands:['R','G','B'], min: 394, max:1876, gamma: 1.7}
Map.addLayer(coleccion, visparam, "RGB_coleccion")
/*Se define la variable gif para generar el video de visualizacion de la coleccion de imagenes en RGB
y se imprime donde se crea un enlace del video con la coleccion*/
var gif = coleccion.getVideoThumbURL(visparam)
print
/*Se define la variable de parametros para la generacion del indice NDVI para cada imagen de la
coleccion y se crea la funcion de normalizacion diferenciada para el NDVI de cada imagen
recortada al area del poligono de la geometria dada, de igual forma se define una mascara para los
valores de NDVI superiores a 0.5*/
var parametrosndvi = {min:-0.5, max:0.9, palette: ['blue', 'black', 'white', 'yellow', 'green', 'red']}
var ndvi = coleccion.map(function (c){return c.normalizedDifference(['N','R']).clip(geometry)})
var visndvi = ndvi.map(function (f){return f.visualize(parametrosndvi)})
/*Se realiza el mismo procedimiento para los otros indices SAVI, ARVI, GCI, GCI, EVI*/
var parametrosavi = {min:-0.5, max:0.9, palette: ['blue', 'black', 'white', 'yellow', 'green', 'red']}
var savi = coleccion.map(function (a){return a.expression('(1+L)*((nir-red)/(nir+red+L))',
{
nir : a.select('N').divide(10000),
red : a.select('R').divide(10000),
L : 0.5
}).clip(geometry)})
var visavi = savi.map(function (a){return a.visualize(parametrosavi)})
var parametrosarvi = {min:-0.5, max:0.9, palette: ['blue', 'black', 'white', 'yellow', 'green', 'red']}
var arvi = coleccion.map(function (b){return b.expression('(nir-(2*red)+blue)/(nir+(2*red)+blue)',
{
nir : b.select('N').divide(10000),
red : b.select('R').divide(10000),
blue : b.select('B').divide(10000),
}).clip(geometry)})
var visarvi = arvi.map(function (b){return b.visualize(parametrosarvi)})
var parametrosgci = {min:-0.5, max:10, palette: ['blue', 'black', 'white', 'yellow', 'green', 'red']}
var gci = coleccion.map(function (e){return e.expression('((nir)/(green))-(L)',
{
nir : e.select('N').divide(10000),
green : e.select('G').divide(10000),
L : 1,
}).clip(geometry)})
var visgci = gci.map(function (e){return e.visualize(parametrosgci)})
var parametroevi = {min:-0.5, max:0.9, palette: ['blue', 'black', 'white', 'yellow', 'green', 'red']}
var evi = coleccion.map(function (g){return g.expression('2.5*((nir-red)/(nir+(red*C)-(B*blue)+L))',
{
nir : g.select('N').divide(10000),
red : g.select('R').divide(10000),
blue : g.select('B').divide(10000),
C : 6,
B : 7.5,
L : 1
}).clip(geometry)})
var visevi = evi.map(function (g){return g.visualize(parametroevi)})
/*Se establece la variable de visualizacion por imagenes por segundo y se crea la visualizacion del
video en la consola con la funcion ui.Thumbnail para los diferentes indices y se imprime para
ver los videos en consola*/
var viscontrol = {framesPerSecond: 3}
var timeserie1 = ui.Thumbnail(visndvi, viscontrol)
var timeserie2 = ui.Thumbnail(visavi, viscontrol)
var timeserie3 = ui.Thumbnail(visarvi, viscontrol)
var timeserie4 = ui.Thumbnail(visgci, viscontrol)
var timeserie5 = ui.Thumbnail(visevi, viscontrol)
print('ndvi', timeserie1)
print('savi', timeserie2)
print('arvi', timeserie3)
print('gci', timeserie4)
print('evi', timeserie5)