Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
ajl2718
commited on
Commit
·
0fda97d
1
Parent(s):
99d5451
Allow multiple addresses
Browse files
app.py
CHANGED
|
@@ -11,8 +11,20 @@ download('au_nsw_lg', 'saunteringcat/whereabouts-db')
|
|
| 11 |
# create a matcher object
|
| 12 |
matcher = Matcher('au_all_sm')
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
return matcher.geocode(address)
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
demo.launch()
|
|
|
|
| 11 |
# create a matcher object
|
| 12 |
matcher = Matcher('au_all_sm')
|
| 13 |
|
| 14 |
+
# function to geocode results
|
| 15 |
+
def geocode(addresses):
|
| 16 |
return matcher.geocode(address)
|
| 17 |
|
| 18 |
+
text_input = gr.Textbox(lines=2, label="Addresses to geocode (one row per address)")
|
| 19 |
+
json_output = gr.JSON(label="Output JSON data")
|
| 20 |
+
|
| 21 |
+
interface_geocoder = gr.Interface(
|
| 22 |
+
fn=geocode,
|
| 23 |
+
inputs=[text_input],
|
| 24 |
+
outputs=[json_output],
|
| 25 |
+
title="Geocoder",
|
| 26 |
+
description="Enter a list of addresses or upload a CSV file of addresses"
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
demo = gr.TabbedInterface([interface_geocoder], ["Geocoding"])
|
| 30 |
demo.launch()
|