pgzmnk commited on
Commit
96e83f4
1 Parent(s): fdda1da

Introduce gee.

Browse files
Files changed (3) hide show
  1. .gitignore +1 -0
  2. app.py +13 -3
  3. requirements.txt +5 -0
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  .venv
2
  __pycache__/
 
 
1
  .venv
2
  __pycache__/
3
+ service_account.json
app.py CHANGED
@@ -1,7 +1,15 @@
1
  import gradio as gr
2
  import plotly.graph_objects as go
3
  from datasets import load_dataset
 
 
4
 
 
 
 
 
 
 
5
  dataset = load_dataset("gradio/NYC-Airbnb-Open-Data", split="train")
6
  df = dataset.to_pandas()
7
 
@@ -43,10 +51,12 @@ def filter_map(min_price, max_price, boroughs):
43
  with gr.Blocks() as demo:
44
  with gr.Column():
45
  with gr.Row():
46
- min_price = gr.Number(value=250, label="Minimum Price")
47
- max_price = gr.Number(value=1000, label="Maximum Price")
48
- boroughs = gr.CheckboxGroup(choices=["Queens", "Brooklyn", "Manhattan", "Bronx", "Staten Island"], value=["Queens", "Brooklyn"], label="Select Boroughs:")
49
  btn = gr.Button(value="Update Filter")
 
 
50
  map = gr.Plot().style()
51
  demo.load(filter_map, [min_price, max_price, boroughs], map)
52
  btn.click(filter_map, [min_price, max_price, boroughs], map)
 
1
  import gradio as gr
2
  import plotly.graph_objects as go
3
  from datasets import load_dataset
4
+ import ee
5
+ # import geemap
6
 
7
+ # GEE
8
+ service_account = 'climatebase-july-2023@ee-geospatialml-aquarry.iam.gserviceaccount.com'
9
+ credentials = ee.ServiceAccountCredentials(service_account, 'service_account.json')
10
+ ee.Initialize(credentials)
11
+
12
+ # Gradio dataset
13
  dataset = load_dataset("gradio/NYC-Airbnb-Open-Data", split="train")
14
  df = dataset.to_pandas()
15
 
 
51
  with gr.Blocks() as demo:
52
  with gr.Column():
53
  with gr.Row():
54
+ min_price = gr.Number(value=250, label="Project Name")
55
+ max_price = gr.Number(value=1000, label="Project Description")
56
+ boroughs = gr.CheckboxGroup(choices=["Queens", "Brooklyn", "Manhattan", "Bronx", "Staten Island"], value=["Queens", "Brooklyn"], label="Select Methodology:")
57
  btn = gr.Button(value="Update Filter")
58
+ btn = gr.Button(value="Save")
59
+ btn = gr.Button(value="Run")
60
  map = gr.Plot().style()
61
  demo.load(filter_map, [min_price, max_price, boroughs], map)
62
  btn.click(filter_map, [min_price, max_price, boroughs], map)
requirements.txt CHANGED
@@ -1,3 +1,8 @@
1
  datasets
2
  plotly
3
  gradio
 
 
 
 
 
 
1
  datasets
2
  plotly
3
  gradio
4
+ duckdb==0.8.1
5
+ geemap
6
+ segment-geospatial
7
+ geojson
8
+ yaml