Spaces:
Sleeping
Sleeping
onfarmview
commited on
Commit
·
a4a6bb0
1
Parent(s):
6302cb8
first time
Browse files
app.py
CHANGED
|
@@ -1,6 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import leafmap.foliumap as leafmap
|
| 3 |
from streamlit.components.v1 import html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
st.set_page_config(layout="wide")
|
| 6 |
|
|
@@ -71,14 +78,23 @@ m = leafmap.Map(
|
|
| 71 |
locate_control=True,
|
| 72 |
plugin_LatLngPopup=False, center=map_center, zoom=8,
|
| 73 |
)
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
| 76 |
# m = leafmap.Map()
|
| 77 |
# m = leafmap.Map(center=[-40.9006, 174.8860], zoom=7)
|
| 78 |
# m.add_basemap("Esri")
|
| 79 |
# m.add_basemap("Stamen.Terrain")
|
| 80 |
# m.add_basemap("CartoDB.Positron")
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
m.to_streamlit(height=700)
|
| 84 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import leafmap.foliumap as leafmap
|
| 3 |
from streamlit.components.v1 import html
|
| 4 |
+
import ee
|
| 5 |
+
import folium
|
| 6 |
+
import pandas
|
| 7 |
+
# import geemap.foliumap as geemap
|
| 8 |
+
# import ee
|
| 9 |
+
from datetime import date, timedelta, datetime
|
| 10 |
+
|
| 11 |
|
| 12 |
st.set_page_config(layout="wide")
|
| 13 |
|
|
|
|
| 78 |
locate_control=True,
|
| 79 |
plugin_LatLngPopup=False, center=map_center, zoom=8,
|
| 80 |
)
|
| 81 |
+
def ee_authenticate(token_name="EARTHENGINE_TOKEN"):
|
| 82 |
+
geemap.ee_initialize(token_name=token_name)
|
| 83 |
+
|
| 84 |
+
ee_authenticate(token_name="4/1AfJohXleDqw1-fV1879iHUDYgPbM7f5OjCKfxFY3vJiiGqQDn_ff-Luhhhk") #4/1AfJohXkTlWMKd8fPevD3hd4tAq_j-YlD2CabTy7QtM7iu1gNB3XdBEqRehA
|
| 85 |
# m = leafmap.Map()
|
| 86 |
# m = leafmap.Map(center=[-40.9006, 174.8860], zoom=7)
|
| 87 |
# m.add_basemap("Esri")
|
| 88 |
# m.add_basemap("Stamen.Terrain")
|
| 89 |
# m.add_basemap("CartoDB.Positron")
|
| 90 |
+
se2 = ee.ImageCollection('COPERNICUS/S2_SR').filterDate(
|
| 91 |
+
startDate,endDate).filter(
|
| 92 |
+
ee.Filter.lt("CLOUDY_PIXEL_PERCENTAGE",80)).map(maskCloudAndShadows).median()
|
| 93 |
+
|
| 94 |
+
band = ['B4','B3','B2']
|
| 95 |
+
rgbViza = {"min":0.0, "max":0.7,"bands":band}
|
| 96 |
+
titlemap = "Sentinel 2 - Natural Color"
|
| 97 |
+
m.addLayer(se2, rgbViza, titlemap)
|
| 98 |
|
| 99 |
m.to_streamlit(height=700)
|
| 100 |
|