Update app.py
Browse files
app.py
CHANGED
@@ -86,8 +86,6 @@ def create_plot(filename, extent, *gdfs):
|
|
86 |
|
87 |
plt.savefig(filename)
|
88 |
|
89 |
-
|
90 |
-
|
91 |
def ss_intersect(geojson1, ss_geoselect, multiplier_factor, default_building_height):
|
92 |
# Read the GeoJSON files
|
93 |
input_gdf = gpd.read_file(geojson1.name)
|
@@ -134,11 +132,10 @@ def ss_intersect(geojson1, ss_geoselect, multiplier_factor, default_building_hei
|
|
134 |
extent = get_max_extent(input_gdf, buffers_gdf)
|
135 |
|
136 |
# Create and save the plot
|
137 |
-
create_plot('output_image.png', extent, input_gdf, intersected_sites_gdf, buffer_union_gdf)
|
138 |
-
|
139 |
|
140 |
# Return the image
|
141 |
-
return
|
142 |
|
143 |
|
144 |
iface = gr.Interface(
|
@@ -150,7 +147,7 @@ iface = gr.Interface(
|
|
150 |
gr.inputs.Number(default=200, label="Default Building Height"), #Can I make this optional?
|
151 |
],
|
152 |
outputs=[
|
153 |
-
gr.outputs.Image(label="Result Image"),
|
154 |
gr.outputs.File(label="Building Buffers"),
|
155 |
gr.outputs.File(label="Union of Building Buffers"),
|
156 |
gr.outputs.Textbox(label="Building and Sensitive Site Vicinities"),
|
|
|
86 |
|
87 |
plt.savefig(filename)
|
88 |
|
|
|
|
|
89 |
def ss_intersect(geojson1, ss_geoselect, multiplier_factor, default_building_height):
|
90 |
# Read the GeoJSON files
|
91 |
input_gdf = gpd.read_file(geojson1.name)
|
|
|
132 |
extent = get_max_extent(input_gdf, buffers_gdf)
|
133 |
|
134 |
# Create and save the plot
|
135 |
+
fig = create_plot('output_image.png', extent, input_gdf, intersected_sites_gdf, buffer_union_gdf)
|
|
|
136 |
|
137 |
# Return the image
|
138 |
+
return fig, "building_buffers.geojson", "buffer_union.geojson", intersection_desc
|
139 |
|
140 |
|
141 |
iface = gr.Interface(
|
|
|
147 |
gr.inputs.Number(default=200, label="Default Building Height"), #Can I make this optional?
|
148 |
],
|
149 |
outputs=[
|
150 |
+
gr.outputs.Image(type="pil", label="Result Image"),
|
151 |
gr.outputs.File(label="Building Buffers"),
|
152 |
gr.outputs.File(label="Union of Building Buffers"),
|
153 |
gr.outputs.Textbox(label="Building and Sensitive Site Vicinities"),
|