File size: 1,329 Bytes
3894000
87f1818
de3d1f9
3894000
de3d1f9
 
3894000
de3d1f9
3894000
de3d1f9
 
86258b2
 
3894000
de3d1f9
ad6c4be
89a1ce6
 
02905e8
c3c16bf
de3d1f9
 
97d5be8
de3d1f9
60f18df
 
3894000
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import gradio as gr
from main_operations import ss_intersect
#from datasets import load_dataset

#ds = load_dataset('psalama/NYC_sensitive_sites', data_files=data_files)

iface = gr.Interface(
    fn=ss_intersect, 
    inputs=[
        gr.inputs.File(label="Building Footprints GeoJSON"),
        gr.Radio(["Parks Properties", "Park Zones"], label="Which Sensitive Sites?", info="From NYC DPR", type="index"),
        gr.inputs.Slider(minimum=0.0, maximum=10.0, default=4.3, label="Building Height Multiplier"),
        gr.inputs.Number(default=200, label="Default Building Height"), #Can I make this optional?
    ], 
    outputs=[
        gr.outputs.Image(type="pil", label="Result Image"),
        gr.outputs.File(label="Building Buffers"),
        gr.outputs.File(label="Union of Building Buffers"),
        gr.outputs.Textbox(label="Building intersection descriptions"),
    ],
    examples=[
        ["files/building4test.geojson", "Parks Properties", 4.3, 200],
        ["files/building4test.geojson", "Park Zones", 4.3, 900],
    ],
    title="Shadow Sensitive Site Proximity",
    description="This tool automatically checks if proposed buildings would cast a shadows on NYC's 'Sensitive Sites'. Upload a GeoJSON file of proposed building footprints to output an image of intersected sensitive sites.",
)

iface.launch()