Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -169,9 +169,8 @@ def create_vector_mask(tiles, output_path):
|
|
| 169 |
# Calculate area in square meters
|
| 170 |
area_m2 = gdf.to_crs(epsg=3857).area.sum()
|
| 171 |
# Convert to hectares
|
| 172 |
-
area_ha = area_m2 / 10000
|
| 173 |
|
| 174 |
-
return gdf,
|
| 175 |
|
| 176 |
|
| 177 |
def main():
|
|
@@ -211,10 +210,10 @@ def main():
|
|
| 211 |
st.write("Processing complete!")
|
| 212 |
|
| 213 |
output_path = "output_mask.shp"
|
| 214 |
-
result_gdf,
|
| 215 |
|
| 216 |
st.write("Vector mask created successfully!")
|
| 217 |
-
st.write(f"Total area occupied by polygons: {
|
| 218 |
|
| 219 |
# Offer the shapefile for download
|
| 220 |
shp_files = [f for f in os.listdir() if
|
|
|
|
| 169 |
# Calculate area in square meters
|
| 170 |
area_m2 = gdf.to_crs(epsg=3857).area.sum()
|
| 171 |
# Convert to hectares
|
|
|
|
| 172 |
|
| 173 |
+
return gdf, area_m2
|
| 174 |
|
| 175 |
|
| 176 |
def main():
|
|
|
|
| 210 |
st.write("Processing complete!")
|
| 211 |
|
| 212 |
output_path = "output_mask.shp"
|
| 213 |
+
result_gdf, area_m2 = create_vector_mask(tiles, output_path)
|
| 214 |
|
| 215 |
st.write("Vector mask created successfully!")
|
| 216 |
+
st.write(f"Total area occupied by polygons: {area_m2:.4f} m^2")
|
| 217 |
|
| 218 |
# Offer the shapefile for download
|
| 219 |
shp_files = [f for f in os.listdir() if
|