Zeel commited on
Commit
954111c
·
1 Parent(s): c944a35
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -4,6 +4,7 @@ import streamlit as st
4
  import pandas as pd
5
  import geopandas as gpd
6
  import leafmap.foliumap as leafmap
 
7
 
8
  # wide streamlit display
9
  st.set_page_config(layout="wide")
@@ -114,6 +115,7 @@ if file_url:
114
  # | Area (ha) | {stats_df['Area (ha)'].item():.2f} ha|
115
  # | Perimeter (m) | {stats_df['Perimeter (m)'].item():.2f} m |"""
116
  # unsafe_allow_html=True)
 
117
  st.markdown(
118
  f"""
119
  <div style="display: flex; justify-content: center;">
@@ -122,6 +124,9 @@ if file_url:
122
  <th>Metric</th>
123
  <th>Value</th>
124
  </tr>
 
 
 
125
  <tr>
126
  <td>Area (ha)</td>
127
  <td>{stats_df['Area (ha)'].item():.2f} ha</td>
@@ -135,6 +140,8 @@ if file_url:
135
  """,
136
  unsafe_allow_html=True,
137
  )
 
 
138
 
139
  csv = stats_df.T.to_csv(index=True)
140
  st.download_button(
 
4
  import pandas as pd
5
  import geopandas as gpd
6
  import leafmap.foliumap as leafmap
7
+ from optree import tree_map
8
 
9
  # wide streamlit display
10
  st.set_page_config(layout="wide")
 
115
  # | Area (ha) | {stats_df['Area (ha)'].item():.2f} ha|
116
  # | Perimeter (m) | {stats_df['Perimeter (m)'].item():.2f} m |"""
117
  # unsafe_allow_html=True)
118
+ str_points = str(tree_map(lambda x: f"{x:.5f}", stats_df["Points"].item())).replace("'", "").replace("],", "],<br>")
119
  st.markdown(
120
  f"""
121
  <div style="display: flex; justify-content: center;">
 
124
  <th>Metric</th>
125
  <th>Value</th>
126
  </tr>
127
+ <tr>
128
+ <td>Points</td>
129
+ <td>{str_points}</td>
130
  <tr>
131
  <td>Area (ha)</td>
132
  <td>{stats_df['Area (ha)'].item():.2f} ha</td>
 
140
  """,
141
  unsafe_allow_html=True,
142
  )
143
+ print(stats_df["Points"].item())
144
+ print(type(stats_df["Points"].item()))
145
 
146
  csv = stats_df.T.to_csv(index=True)
147
  st.download_button(