UjjwalKGupta commited on
Commit
290b6a8
·
verified ·
1 Parent(s): 8b9ab09

Add Comparision Map

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -468,10 +468,16 @@ def generate_comparison_maps(geometry_json, selected_index, selected_years, evi_
468
  start_date = f"{year}-{start_month:02d}-{start_day:02d}"
469
  end_date = f"{year}-{end_month:02d}-{end_day:02d}"
470
 
471
- collection = (ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
 
472
  .filterDate(start_date, end_date)
473
  .filterBounds(ee_geometry)
474
- .map(lambda img: add_indices(img, 'NIR', 'Red', 'Blue', 'Green', evi_vars)))
 
 
 
 
 
475
 
476
  if collection.size().getInfo() == 0:
477
  maps_html.append(f"<div style='text-align:center; padding-top: 50px;'>No data found for {year}.</div>")
 
468
  start_date = f"{year}-{start_month:02d}-{start_day:02d}"
469
  end_date = f"{year}-{end_month:02d}-{end_day:02d}"
470
 
471
+ collection = (
472
+ ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
473
  .filterDate(start_date, end_date)
474
  .filterBounds(ee_geometry)
475
+ .select(
476
+ ["B2", "B3", "B4", "B8"],
477
+ ["Blue", "Green", "Red", "NIR"]
478
+ )
479
+ .map(lambda img: add_indices(img, 'NIR', 'Red', 'Blue', 'Green', evi_vars))
480
+ )
481
 
482
  if collection.size().getInfo() == 0:
483
  maps_html.append(f"<div style='text-align:center; padding-top: 50px;'>No data found for {year}.</div>")