Spaces:
Sleeping
Sleeping
Update pages/Home.py
Browse files- pages/Home.py +50 -30
pages/Home.py
CHANGED
@@ -1,39 +1,59 @@
|
|
1 |
-
import
|
2 |
-
import leafmap.foliumap as leafmap
|
3 |
|
4 |
-
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
st.sidebar.info(markdown)
|
14 |
-
logo = "https://i.imgur.com/UbOXYAU.png"
|
15 |
-
st.sidebar.image(logo)
|
16 |
|
17 |
-
|
18 |
-
|
|
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
This multipage app template demonstrates various interactive web apps created using [streamlit](https://streamlit.io) and [leafmap](https://leafmap.org). It is an open-source project and you are very welcome to contribute to the [GitHub repository](https://github.com/opengeos/streamlit-map-template).
|
23 |
-
"""
|
24 |
-
)
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
1. For the [GitHub repository](https://github.com/opengeos/streamlit-map-template) or [use it as a template](https://github.com/opengeos/streamlit-map-template/generate) for your own project.
|
30 |
-
2. Customize the sidebar by changing the sidebar text and logo in each Python files.
|
31 |
-
3. Find your favorite emoji from https://emojipedia.org.
|
32 |
-
4. Add a new app to the `pages/` directory with an emoji in the file name, e.g., `1_🚀_Chart.py`.
|
33 |
-
"""
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import solara
|
|
|
2 |
|
|
|
3 |
|
4 |
+
@solara.component
|
5 |
+
def Page():
|
6 |
+
with solara.Column(align="center"):
|
7 |
+
markdown = """
|
8 |
+
## Earth Engine Web Apps
|
9 |
+
|
10 |
+
### Introduction
|
11 |
|
12 |
+
**A collection of Earth Engine web apps developed using [Solara](https://github.com/widgetti/solara) and geemap**
|
|
|
|
|
|
|
13 |
|
14 |
+
- Web App: <https://giswqs-solara-geemap.hf.space>
|
15 |
+
- GitHub: <https://github.com/opengeos/solara-geemap>
|
16 |
+
- Hugging Face: <https://huggingface.co/spaces/giswqs/solara-geemap>
|
17 |
|
18 |
+
|
19 |
+
### How to deploy this app on Hugging Face Spaces
|
|
|
|
|
|
|
20 |
|
21 |
+
1. Go to <https://huggingface.co/spaces/giswqs/solara-geemap/tree/main> and duplicate the space to your own space.
|
22 |
|
23 |
+

|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
2. You need to set `EARTHENGINE_TOKEN` in order to use Earth Engine. The token value should be copied from the following file depending on your operating system:
|
26 |
|
27 |
+
```text
|
28 |
+
Windows: C:\\Users\\USERNAME\\.config\\earthengine\\credentials
|
29 |
+
Linux: /home/USERNAME/.config/earthengine/credentials
|
30 |
+
MacOS: /Users/USERNAME/.config/earthengine/credentials
|
31 |
+
```
|
32 |
+
|
33 |
+
Simply open the file and copy **ALL** the content to the `EARTHENGINE_TOKEN` environment variable.
|
34 |
+
|
35 |
+

|
36 |
+
|
37 |
+

|
38 |
+
|
39 |
+
|
40 |
+
```python
|
41 |
+
import geemap
|
42 |
+
geemap.get_ee_token()
|
43 |
+
```
|
44 |
+
|
45 |
+
Copy all the content of the printed token and set it as the `EARTHENGINE_TOKEN` environment variable.
|
46 |
+
|
47 |
+
3. After the space is built successfully, click the `Embed this Space` menu and find the `Direct URL` for the app, such as <https://giswqs-solara-geemap.hf.space>.
|
48 |
+
|
49 |
+

|
50 |
+
|
51 |
+

|
52 |
+
|
53 |
+
4. Add your own apps (*.py) to the `pages` folder.
|
54 |
+
|
55 |
+
5. Commit and push your changes to the repository. Wait for the space to be built successfully.
|
56 |
+
|
57 |
+
"""
|
58 |
+
|
59 |
+
solara.Markdown(markdown)
|