Índice

1 El concepto de FeatureCollection

(volver al índice)

El set de entrenamiento se construye del siguiente modo con sampleRegions:

  training <- first$select(bands)$sampleRegions(
        collection = fc_puntos,
        properties = list(label),
        scale = 30
  )

donde fc_puntos es un FeatureCollection que es simplemente una columna con geometrias y otra con el valor de un atributo.

Estructura de una FC:

Es muy importante comprender que tanto name como fill son los nombres de las columnas, siendo los atributos de , por ejemplo name, Colorado y Utah.

fc <- ee$FeatureCollection(list(
  ee$Feature(
    ee$Geometry$Polygon(
      list(
        c(-109.05, 41),
        c(-109.05, 37),
        c(-102.05, 37),
        c(-102.05, 41)
      )
    ),
    list(name = "Colorado", fill = 1)
  ),
  ee$Feature(
    ee$Geometry$Polygon(
      list(
        c(-114.05, 37.0),
        c(-109.05, 37.0),
        c(-109.05, 41.0),
        c(-111.05, 41.0),
        c(-111.05, 42.0),
        c(-114.05, 42.0)
      )
    ),
    list(name = "Utah", fill = 2)
  )
))
Map$addLayer(fc)

Esta area es enorme lo que nos traera problemas de rendimiento.

Construyamos un FeatureCollection con dos areas asociadas a dos valores de nd, 0 y 1:

fc_chico <- ee$FeatureCollection(list(

  ee$Feature(
    ee$Geometry$Polygon(
      list(
        c(-72.19614, -42.12838),
        c(-72.10482, -42.12940), 
        c(-72.10413, -42.19811), 
        c(-72.19614, -42.19684) 
      )
    ),
    list(nd = 0)
  ),
    ee$Feature(
    ee$Geometry$Polygon(
      list(
        c(-72.19614, -42.2),
        c(-72.10482, -42.2), 
        c(-72.10413, -42.3), 
        c(-72.19614, -42.3) 
      )
    ),
    list(nd = 1)
  )
))
Map$setCenter(lon = -72.151, lat = -42.1988, zoom = 8)
Map$addLayer(fc_chico)

2 La FC como objeto de construcción del set de entrenamiento

(volver al índice)

fc_chico ahora es nuestro FC

# Input imagery is a cloud-free Landsat 8 composite.
l8 <- ee$ImageCollection("LANDSAT/LC08/C01/T1")

image <- ee$Algorithms$Landsat$simpleComposite(
  collection = l8$filterDate("2018-01-01", "2018-12-31"),
  asFloat = TRUE
)

# Use these bands for prediction.
bands <- c("B2", "B3", "B4", "B5", "B6", "B7", "B10", "B11")

# Load training points. The numeric property 'class' stores known labels.
points <- ee$FeatureCollection("GOOGLE/EE/DEMOS/demo_landcover_labels")

# This property of the table stores the land cover labels.
label <- "nd"

# Overlay the points on the imagery to get training.
training <- image$select(bands)$sampleRegions(
  collection = fc_chico,
  properties = list(label),
  scale = 30
)

# Train a CART classifier with default parameters.
trained <- ee$Classifier$smileCart()$train(training, label, bands)

# Classify the image with the same bands used for training.
classified <- image$select(bands)$classify(trained)

# Viz parameters.
viz_img <- list(bands = c("B4", "B3", "B2"), max = 0.4)
viz_class <- list(palette = c("red", "green", "blue"), min = 0, max = 2)

# Display the inputs and the results.
Map$centerObject(points)
## NOTE: Center obtained from the first element.
Map$addLayer(image, viz_img, name = "image") +
Map$addLayer(classified, viz_class, name = "classification")

3 Random Forest con puntos

(volver al índice)


fc_puntos <- ee$FeatureCollection(list(

  ee$Feature(
    ee$Geometry$Point(
      -72.19614, -42.2
    ),
    list(nd = 0)
  ),
    ee$Feature(
    ee$Geometry$Point(
      -72.19615, -42.1
      
    ),
    list(nd = 1)
  )
))
Map$setCenter(lon = -72.151, lat = -42.1988, zoom = 7)
Map$addLayer(fc_puntos)



# Input imagery is a cloud-free Landsat 8 composite.
l8 <- ee$ImageCollection("LANDSAT/LC08/C01/T1")

image <- ee$Algorithms$Landsat$simpleComposite(
  collection = l8$filterDate("2018-01-01", "2018-12-31"),
  asFloat = TRUE
)

# Use these bands for prediction.
bands <- c("B2", "B3", "B4", "B5", "B6", "B7", "B10", "B11")

# Load training points. The numeric property 'class' stores known labels.
points <- ee$FeatureCollection("GOOGLE/EE/DEMOS/demo_landcover_labels")

# This property of the table stores the land cover labels.
label <- "nd"

# Overlay the points on the imagery to get training.
training <- image$select(bands)$sampleRegions(
  collection = fc_puntos,
  properties = list(label),
  scale = 30
)

# Train a CART classifier with default parameters.
trained <- ee$Classifier$smileCart()$train(training, label, bands)

# Classify the image with the same bands used for training.
classified <- image$select(bands)$classify(trained)

# Viz parameters.
viz_img <- list(bands = c("B4", "B3", "B2"), max = 0.4)
viz_class <- list(palette = c("red", "green", "blue"), min = 0, max = 2)

# Display the inputs and the results.
Map$centerObject(points)
## NOTE: Center obtained from the first element.
Map$addLayer(image, viz_img, name = "image") +
Map$addLayer(classified, viz_class, name = "classification")

4 RF nuestro conjunto muestral

(volver al índice)

Tenemos un dataframe que queremos integrar como Feature collection a un set de entrenamiento.

rescatemos nuestras muestras:

u <- readRDS("union_de_muestras.rds")
kbl(u) %>%
kable_styling(bootstrap_options = c("striped", "hover")) %>%
kable_paper() %>%
scroll_box(width = "100%", height = "500px")
nd geometry
1 0 POINT (-72.23802 -42.99786)
2 0 POINT (-72.22904 -42.99786)
4 0 POINT (-72.23802 -42.98888)
5 0 POINT (-72.22904 -42.98888)
6 0 POINT (-72.22006 -42.98888)
8 0 POINT (-72.25599 -42.97989)
9 0 POINT (-72.21107 -42.97989)
10 0 POINT (-72.27396 -42.97091)
11 0 POINT (-72.22006 -42.97091)
12 0 POINT (-72.22904 -42.90803)
13 0 POINT (-72.24701 -42.89905)
14 0 POINT (-72.23802 -42.89905)
15 0 POINT (-72.52548 -42.88108)
17 0 POINT (-72.53447 -42.8721)
22 0 POINT (-72.53447 -42.86311)
27 0 POINT (-72.4626 -42.85413)
32 0 POINT (-72.45362 -42.84515)
37 0 POINT (-72.33684 -42.83616)
38 0 POINT (-72.32786 -42.83616)
39 0 POINT (-72.31887 -42.83616)
40 0 POINT (-72.30989 -42.83616)
41 0 POINT (-72.52548 -42.82718)
42 0 POINT (-72.5165 -42.82718)
44 0 POINT (-72.26497 -42.82718)
49 0 POINT (-72.50752 -42.80023)
58 0 POINT (-72.37277 -42.77328)
59 0 POINT (-72.36379 -42.77328)
60 0 POINT (-72.3548 -42.77328)
61 0 POINT (-72.47159 -42.7643)
62 0 POINT (-72.4626 -42.7643)
63 0 POINT (-72.45362 -42.7643)
67 0 POINT (-72.39074 -42.7643)
68 0 POINT (-72.38175 -42.7643)
70 0 POINT (-72.33684 -42.6565)
71 0 POINT (-72.30091 -42.63853)
73 0 POINT (-72.28294 -42.62955)
74 0 POINT (-72.33684 -42.61159)
75 0 POINT (-72.26497 -42.61159)
76 0 POINT (-72.34582 -42.6026)
77 0 POINT (-72.33684 -42.6026)
78 0 POINT (-72.34582 -42.59362)
79 0 POINT (-72.38175 -42.58464)
80 0 POINT (-72.37277 -42.58464)
81 0 POINT (-72.31887 -42.57565)
82 0 POINT (-72.34582 -42.56667)
83 0 POINT (-72.39972 -42.55769)
84 0 POINT (-72.21107 -42.53972)
85 0 POINT (-72.20209 -42.50379)
86 0 POINT (-72.38175 -42.44989)
87 0 POINT (-72.37277 -42.44989)
89 0 POINT (-72.38175 -42.44091)
90 0 POINT (-72.37277 -42.44091)
91 0 POINT (-72.38175 -42.43192)
92 0 POINT (-72.24701 -42.42294)
93 0 POINT (-72.34582 -42.41396)
95 0 POINT (-72.32786 -42.40497)
96 0 POINT (-72.37277 -42.39599)
97 0 POINT (-72.37277 -42.38701)
98 0 POINT (-72.23802 -42.38701)
99 0 POINT (-72.28294 -42.36006)
100 0 POINT (-72.23802 -42.33311)
101 0 POINT (-72.22006 -42.33311)
102 0 POINT (-72.22006 -42.31514)
103 0 POINT (-72.22904 -42.30616)
104 0 POINT (-72.22006 -42.29718)
106 0 POINT (-72.25599 -42.26124)
107 0 POINT (-72.27396 -42.25226)
108 0 POINT (-72.22006 -42.25226)
109 0 POINT (-72.21107 -42.25226)
110 0 POINT (-72.20209 -42.25226)
111 0 POINT (-72.20209 -42.16243)
112 0 POINT (-72.21107 -42.15344)
113 0 POINT (-72.20209 -42.15344)
114 0 POINT (-72.23802 -42.14446)
115 0 POINT (-72.25599 -42.13548)
117 0 POINT (-72.22904 -42.13548)
118 0 POINT (-72.25599 -42.1265)
119 0 POINT (-72.24701 -42.1265)
124 0 POINT (-72.22006 -42.09955)
126 0 POINT (-72.34582 -42.09056)
128 0 POINT (-72.25599 -42.09056)
129 0 POINT (-72.23802 -42.09056)
130 0 POINT (-72.22006 -42.09056)
131 0 POINT (-72.21107 -42.09056)
132 0 POINT (-72.23802 -42.08158)
133 0 POINT (-72.21107 -42.0726)
134 0 POINT (-72.33684 -42.06361)
135 0 POINT (-72.29192 -42.06361)
138 0 POINT (-72.25599 -42.06361)
139 0 POINT (-72.33684 -42.05463)
140 0 POINT (-72.32786 -42.05463)
141 0 POINT (-72.30989 -42.05463)
142 0 POINT (-72.3548 -42.04565)
143 0 POINT (-72.33684 -42.04565)
145 0 POINT (-72.30989 -42.04565)
146 0 POINT (-72.36379 -42.03666)
147 0 POINT (-72.3548 -42.03666)
149 0 POINT (-72.30091 -42.03666)
150 0 POINT (-72.29192 -42.03666)
151 0 POINT (-72.31887 -42.02768)
152 0 POINT (-72.30091 -42.02768)
153 0 POINT (-72.3548 -42.0187)
154 0 POINT (-72.34582 -42.0187)
155 0 POINT (-72.29192 -42.0187)
157 0 POINT (-72.22904 -42.0187)
158 0 POINT (-72.22006 -42.0187)
159 0 POINT (-72.21107 -42.0187)
160 0 POINT (-72.20209 -42.0187)
161 0 POINT (-72.3548 -42.00971)
162 0 POINT (-72.34582 -42.00971)
164 0 POINT (-72.22904 -42.00971)
165 0 POINT (-72.22006 -42.00971)
166 0 POINT (-72.21107 -42.00971)
167 0 POINT (-72.3548 -42.00073)
168 0 POINT (-72.33684 -42.00073)
170 0 POINT (-72.25599 -42.00073)
18 1 POINT (-72.98812 -42.98439)
210 1 POINT (-72.89829 -42.98439)
3 1 POINT (-72.80845 -42.98439)
410 1 POINT (-72.71862 -42.98439)
510 1 POINT (-72.62879 -42.98439)
610 1 POINT (-72.53896 -42.98439)
7 1 POINT (-72.44913 -42.98439)
810 1 POINT (-72.3593 -42.98439)
910 1 POINT (-72.26946 -42.98439)
105 1 POINT (-72.98812 -42.89455)
116 1 POINT (-72.89829 -42.89455)
121 1 POINT (-72.80845 -42.89455)
136 1 POINT (-72.71862 -42.89455)
156 1 POINT (-72.53896 -42.89455)
16 1 POINT (-72.44913 -42.89455)
171 1 POINT (-72.3593 -42.89455)
19 1 POINT (-72.98812 -42.80472)
20 1 POINT (-72.89829 -42.80472)
21 1 POINT (-72.80845 -42.80472)
221 1 POINT (-72.71862 -42.80472)
23 1 POINT (-72.62879 -42.80472)
24 1 POINT (-72.53896 -42.80472)
25 1 POINT (-72.3593 -42.80472)
26 1 POINT (-72.26946 -42.80472)
271 1 POINT (-72.98812 -42.71489)
28 1 POINT (-72.89829 -42.71489)
29 1 POINT (-72.80845 -42.71489)
30 1 POINT (-72.71862 -42.71489)
31 1 POINT (-72.62879 -42.71489)
321 1 POINT (-72.53896 -42.71489)
33 1 POINT (-72.44913 -42.71489)
34 1 POINT (-72.3593 -42.71489)
35 1 POINT (-72.26946 -42.71489)
36 1 POINT (-72.98812 -42.62506)
371 1 POINT (-72.89829 -42.62506)
381 1 POINT (-72.80845 -42.62506)
391 1 POINT (-72.71862 -42.62506)
401 1 POINT (-72.62879 -42.62506)
411 1 POINT (-72.53896 -42.62506)
421 1 POINT (-72.44913 -42.62506)
43 1 POINT (-72.3593 -42.62506)
441 1 POINT (-72.26946 -42.62506)
45 1 POINT (-72.98812 -42.53523)
46 1 POINT (-72.89829 -42.53523)
47 1 POINT (-72.80845 -42.53523)
48 1 POINT (-72.71862 -42.53523)
491 1 POINT (-72.62879 -42.53523)
50 1 POINT (-72.53896 -42.53523)
51 1 POINT (-72.44913 -42.53523)
52 1 POINT (-72.3593 -42.53523)
53 1 POINT (-72.26946 -42.53523)
54 1 POINT (-72.98812 -42.4454)
55 1 POINT (-72.89829 -42.4454)
56 1 POINT (-72.80845 -42.4454)
57 1 POINT (-72.71862 -42.4454)
581 1 POINT (-72.62879 -42.4454)
591 1 POINT (-72.53896 -42.4454)
601 1 POINT (-72.44913 -42.4454)
611 1 POINT (-72.3593 -42.4454)
621 1 POINT (-72.26946 -42.4454)
631 1 POINT (-72.98812 -42.35557)
64 1 POINT (-72.89829 -42.35557)
65 1 POINT (-72.80845 -42.35557)
66 1 POINT (-72.71862 -42.35557)
671 1 POINT (-72.62879 -42.35557)
681 1 POINT (-72.53896 -42.35557)
69 1 POINT (-72.44913 -42.35557)
701 1 POINT (-72.3593 -42.35557)
711 1 POINT (-72.26946 -42.35557)
72 1 POINT (-72.98812 -42.26573)
731 1 POINT (-72.89829 -42.26573)
741 1 POINT (-72.80845 -42.26573)
751 1 POINT (-72.71862 -42.26573)
761 1 POINT (-72.62879 -42.26573)
771 1 POINT (-72.53896 -42.26573)
781 1 POINT (-72.44913 -42.26573)
791 1 POINT (-72.3593 -42.26573)
801 1 POINT (-72.26946 -42.26573)
811 1 POINT (-72.98812 -42.1759)
821 1 POINT (-72.89829 -42.1759)
831 1 POINT (-72.80845 -42.1759)
841 1 POINT (-72.71862 -42.1759)
851 1 POINT (-72.62879 -42.1759)
861 1 POINT (-72.53896 -42.1759)
871 1 POINT (-72.44913 -42.1759)
88 1 POINT (-72.3593 -42.1759)
891 1 POINT (-72.26946 -42.1759)
901 1 POINT (-72.98812 -42.08607)
911 1 POINT (-72.89829 -42.08607)
921 1 POINT (-72.80845 -42.08607)
931 1 POINT (-72.71862 -42.08607)
94 1 POINT (-72.62879 -42.08607)
951 1 POINT (-72.53896 -42.08607)
961 1 POINT (-72.44913 -42.08607)
971 1 POINT (-72.3593 -42.08607)
roi_2 <- ee$Geometry$MultiPoint(u$geometry[1:100])
Map$setCenter(lon = -72.151, lat = -42.1988, zoom = 7)
Map$addLayer(roi_2)

Vamos a crear un programa para construir la estructura sintactica de una FC para entrenar nuestro RF.

union_a_b <- data.frame()
i = 1
aaa <- u$nd[i]
bbb <- u$geometry[[i]]
union_a_b <- cbind(aaa,bbb[1],bbb[2])
# <- rbind(union_a_b,union_a_b)
union_a_b
##      aaa                    
## [1,]   0 -72.23802 -42.99786
i = 2
aaa <- u$nd[i]
bbb <- u$geometry[[i]]
union_a_b_2 <- cbind(aaa,bbb[1],bbb[2])
union_a_b <- rbind(union_a_b,union_a_b_2)
union_a_b
##      aaa                    
## [1,]   0 -72.23802 -42.99786
## [2,]   0 -72.22904 -42.99786
i = 3
aaa <- u$nd[i]
bbb <- u$geometry[[i]]
union_a_b_2 <- cbind(aaa,bbb[1],bbb[2])
union_a_b <- rbind(union_a_b,union_a_b_2)
union_a_b
##      aaa                    
## [1,]   0 -72.23802 -42.99786
## [2,]   0 -72.22904 -42.99786
## [3,]   0 -72.23802 -42.98888
t <- seq(2, 211, by = 1)

for(i in t){
  
  aaa <- u$nd[i]
bbb <- u$geometry[[i]]
union_a_b_2 <- cbind(aaa,bbb[1],bbb[2])
union_a_b <- rbind(union_a_b,union_a_b_2)

  
}
head(union_a_b,5)
##      aaa                    
## [1,]   0 -72.23802 -42.99786
## [2,]   0 -72.22904 -42.99786
## [3,]   0 -72.23802 -42.98888
## [4,]   0 -72.22904 -42.99786
## [5,]   0 -72.23802 -42.98888
nrow(union_a_b)
## [1] 213


palabra <- ""
palabra <-  paste("ee$Feature(ee$Geometry$Point(", union_a_b[,2] , ",", union_a_b[,3] , ")," , "list(nd =" , union_a_b[,1] ,")),")
palabra2 <- ""
for (nn in 1:211) {
palabra2 <- paste(palabra2,palabra[nn])

}

Un método de construcción

(volver al índice)

Se construye la estructura del conjunto de muestras como Feature guardándola en formato excel, copiándola y pegándola en el código. No es ineficiente pero una forma más limpia sería manipulando el objeto como un gee object. Queda ésto pendiente.

palabra2 <- data.frame()
for (nn in 1:211) {
palabra2 <- rbind(palabra2,palabra[nn])

}
library(writexl)
library("readxl")
write_xlsx(palabra2,"palabra2.xlsx") 
fc_puntos <- ee$FeatureCollection(list(

 ee$Feature(ee$Geometry$Point( -72.2380236 , -42.9978611 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2290404 , -42.9978611 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2380236 , -42.9888779 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2290404 , -42.9888779 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.9888779 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2559899 , -42.9798948 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.9798948 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2739562 , -42.9709116 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.9709116 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2290404 , -42.9080295 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2470067 , -42.8990464 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2380236 , -42.8990464 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.5254845 , -42.8810801 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.5344676 , -42.8720969 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.5344676 , -42.8631138 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.4626024 , -42.8541306 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.4536192 , -42.8451475 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.8361643 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3278551 , -42.8361643 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3188719 , -42.8361643 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3098888 , -42.8361643 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.5254845 , -42.8271812 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.5165013 , -42.8271812 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.264973 , -42.8271812 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.5075182 , -42.8002317 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3727709 , -42.7732823 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3637877 , -42.7732823 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3548046 , -42.7732823 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.4715855 , -42.7642991 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.4626024 , -42.7642991 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.4536192 , -42.7642991 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3907372 , -42.7642991 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.381754 , -42.7642991 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.6565013 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3009056 , -42.638535 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2829393 , -42.6295518 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.6115855 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.264973 , -42.6115855 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3458214 , -42.6026023 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.6026023 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3458214 , -42.5936192 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.381754 , -42.584636 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3727709 , -42.584636 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3188719 , -42.5756529 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3458214 , -42.5666697 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3997203 , -42.5576866 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.5397203 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.202091 , -42.5037877 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.381754 , -42.4498888 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3727709 , -42.4498888 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.381754 , -42.4409056 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3727709 , -42.4409056 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.381754 , -42.4319224 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2470067 , -42.4229393 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3458214 , -42.4139561 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3278551 , -42.404973 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3727709 , -42.3959898 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3727709 , -42.3870067 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2380236 , -42.3870067 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2829393 , -42.3600572 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2380236 , -42.3331078 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.3331078 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.3151415 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2290404 , -42.3061583 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.2971752 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2559899 , -42.2612425 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2739562 , -42.2522594 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.2522594 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.2522594 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.202091 , -42.2522594 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.202091 , -42.1624279 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.1534447 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.202091 , -42.1534447 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2380236 , -42.1444616 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2559899 , -42.1354784 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2290404 , -42.1354784 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2559899 , -42.1264952 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2470067 , -42.1264952 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.0995458 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3458214 , -42.0905626 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2559899 , -42.0905626 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2380236 , -42.0905626 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.0905626 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.0905626 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2380236 , -42.0815795 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.0725963 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.0636132 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2919225 , -42.0636132 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2559899 , -42.0636132 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.05463 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3278551 , -42.05463 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3098888 , -42.05463 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3548046 , -42.0456469 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.0456469 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3098888 , -42.0456469 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3637877 , -42.0366637 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3548046 , -42.0366637 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3009056 , -42.0366637 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2919225 , -42.0366637 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3188719 , -42.0276806 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3009056 , -42.0276806 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3548046 , -42.0186974 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3458214 , -42.0186974 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2919225 , -42.0186974 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2290404 , -42.0186974 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.0186974 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.0186974 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.202091 , -42.0186974 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3548046 , -42.0097143 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3458214 , -42.0097143 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2290404 , -42.0097143 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2200573 , -42.0097143 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2110741 , -42.0097143 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3548046 , -42.0007311 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.3368383 , -42.0007311 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.2559899 , -42.0007311 ), list(nd = 0 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.9843863 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.8945548 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.8945548 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.8945548 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.8945548 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.8945548 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.8945548 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.8945548 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.8047233 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.7148918 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.6250602 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.5352287 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.4453972 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.3555656 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.2657341 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.2694646 , -42.1759026 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.9881168 , -42.0860711 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8982853 , -42.0860711 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.8084538 , -42.0860711 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.7186222 , -42.0860711 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.6287907 , -42.0860711 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.5389592 , -42.0860711 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.4491277 , -42.0860711 ), list(nd = 1 )),
ee$Feature(ee$Geometry$Point( -72.3592961 , -42.0860711 ), list(nd = 1 ))
 

))
mask <- st_read("region_los_lagos.shp", 
        quiet = TRUE) %>% 
        sf_as_ee()

# convertimos el shp en geometria:
region <- mask$geometry()

start <- ee$Date("2019-03-01")
finish <- ee$Date("2020-03-01")
cc <- 20

sentinel1 = ee$ImageCollection('COPERNICUS/S2')$filterDate(start, finish)$filterBounds(region)$
  filter(ee$Filter$lt("CLOUDY_PIXEL_PERCENTAGE", cc))

first <- sentinel1$median()

# Use these bands for prediction.
bands <- c("B2", "B3", "B4", "B5", "B6", "B7", "B10", "B11")


# This property of the table stores the land cover labels.
label <- "nd"

# Overlay the points on the imagery to get training.
training <- first$select(bands)$sampleRegions(
  collection = fc_puntos,
  properties = list(label),
  scale = 30
)

# Train a CART classifier with default parameters.
trained <- ee$Classifier$smileCart()$train(training, label, bands)

# Classify the image with the same bands used for training.
classified <- first$select(bands)$classify(trained)

# Viz parameters.
# viz_img <- list(bands = c("B4", "B3", "B2"), max = 0.4)
vizParams <- list(
  bands = c("B8","B5" , "B3"),
  #  bands = c("B2", "B3"),
  min = 100,
  max = 1000,
  gamma = 2
)

viz_class <- list(palette = c("red", "green", "blue"), min = 0, max = 2)



Map$addLayer(first, vizParams, name = "image") +
Map$addLayer(classified, viz_class, name = "classification")




Algebra de conjuntos:

(volver al índice)

# Create two circular geometries.
poly1 <- ee$Geometry$Point(c(-50, 30))$buffer(1e6)
poly2 <- ee$Geometry$Point(c(-40, 30))$buffer(1e6)

# Display polygon 1 in red and polygon 2 in blue.
Map$setCenter(-45, 30,  zoom = 3)
Map$addLayer(poly1, list(color = "#666666"), "poly1") +
Map$addLayer(poly2, list(color = "#7f7f7f"), "poly2")
# Compute the intersection, display it in blue.
Map$setCenter(-45, 30,  zoom = 3)
intersection <- poly1$intersection(poly2, ee$ErrorMargin(1))
Map$addLayer(intersection, list(color = "#7f7f7f"), "intersection")
# Compute the union, display it in magenta.
Map$setCenter(-45, 30,  zoom = 3)
union <- poly1$union(poly2, ee$ErrorMargin(1))
Map$addLayer(union, list(color = "#666666"), "union")
# Compute the difference, display in yellow.
Map$setCenter(-45, 30,  zoom = 3)
diff1 <- poly1$difference(poly2, ee$ErrorMargin(1))
Map$addLayer(diff1, list(color = "#666666"), "diff1")

https://www.rdocumentation.org/packages/BiocGenerics/versions/0.18.0/topics/sets

# selectMethod("intersect",c(region, region_0))
# ggg

Ejemplo 1: grafica de una caja

box <- ee$Geometry$Rectangle(coords = c(-73,-43,-72.462,-42.811),
                             ## WGS 84
                             proj = "EPSG:4326",
                             geodesic = FALSE)

Map$setCenter(lon = -73.079, lat = -42.611, zoom = 7)
Map$addLayer(box)

Ejemplo 2: estadisticas de un shp:

vias<-readOGR(".","region_los_lagos")
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\Users\usuario\Desktop\ds\ds_rgee\cart", layer: "region_los_lagos"
## with 1 features
## It has 17 fields
## Integer64 fields read as strings:  FID_1 TOTAL_VIVI PARTICULAR COLECTIVAS TOTAL_PERS HOMBRES MUJERES
summary(vias)
## Object of class SpatialPolygonsDataFrame
## Coordinates:
##         min       max
## x -74.83774 -71.58093
## y -44.06706 -40.23878
## Is projected: FALSE 
## proj4string : [+proj=longlat +datum=WGS84 +no_defs]
## Data attributes:
##     FID_1              REGION           NOM_REGION         TOTAL_VIVI       
##  Length:1           Length:1           Length:1           Length:1          
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##   PARTICULAR         COLECTIVAS         TOTAL_PERS          HOMBRES         
##  Length:1           Length:1           Length:1           Length:1          
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##    MUJERES             DENSIDAD       INDICE_MAS      INDICE_DEP   
##  Length:1           Min.   :17.11   Min.   :97.64   Min.   :47.03  
##  Class :character   1st Qu.:17.11   1st Qu.:97.64   1st Qu.:47.03  
##  Mode  :character   Median :17.11   Median :97.64   Median :47.03  
##                     Mean   :17.11   Mean   :97.64   Mean   :47.03  
##                     3rd Qu.:17.11   3rd Qu.:97.64   3rd Qu.:47.03  
##                     Max.   :17.11   Max.   :97.64   Max.   :47.03  
##    IND_DEP_JU      IND_DEP_VE      SHAPE_Leng        Shape_Le_1   
##  Min.   :30.55   Min.   :16.48   Min.   :7760164   Min.   :60.65  
##  1st Qu.:30.55   1st Qu.:16.48   1st Qu.:7760164   1st Qu.:60.65  
##  Median :30.55   Median :16.48   Median :7760164   Median :60.65  
##  Mean   :30.55   Mean   :16.48   Mean   :7760164   Mean   :60.65  
##  3rd Qu.:30.55   3rd Qu.:16.48   3rd Qu.:7760164   3rd Qu.:60.65  
##  Max.   :30.55   Max.   :16.48   Max.   :7760164   Max.   :60.65  
##    Shape_Area   
##  Min.   :5.259  
##  1st Qu.:5.259  
##  Median :5.259  
##  Mean   :5.259  
##  3rd Qu.:5.259  
##  Max.   :5.259

https://ecodata.nrel.colostate.edu/gdpe-gee-remote-sensing-lessons/module7.html

Referencias:

https://drive.google.com/drive/folders/1yDB9oZBS6ZSZ-U1Rf7WsNlLdaHdHl-3z

https://rstudio-pubs-static.s3.amazonaws.com/643255_63554e7e1f9f466dad4f9e62ff977a88.html

https://drive.google.com/drive/folders/1yDB9oZBS6ZSZ-U1Rf7WsNlLdaHdHl-3z?usp=sharing

https://rstudio-pubs-static.s3.amazonaws.com/639598_f8b124e23b7949a49250693dc3c5a6a7.html

https://github.com/csaybar/rgee/blob/examples//GetStarted/03_finding_images.R

https://rpubs.com/daniballari/raster

https://stackoverflow.com/questions/63543942/raster-does-not-align-with-shapefile-after-processing-with-rgee

https://rpubs.com/ohfrancom/618462

https://www.ide.cl/index.php/limites-y-fronteras/item/1528-division-politica-administrativa-2020

Catastro de Lagos https://www.ide.cl/index.php/aguas-continentales/item/1508-catastro-de-lagos

Lagos de Chile
http://datos.cedeus.cl/layers/geonode:cl_lagos_geo