Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,10 @@ import requests
|
|
4 |
# Function to get latitude and longitude from a place name using Nominatim
|
5 |
def get_lat_lon(place_name):
|
6 |
url = f"https://nominatim.openstreetmap.org/search?q={place_name}&format=json&limit=1"
|
7 |
-
|
|
|
|
|
|
|
8 |
if response.status_code == 200:
|
9 |
results = response.json()
|
10 |
if results:
|
|
|
4 |
# Function to get latitude and longitude from a place name using Nominatim
|
5 |
def get_lat_lon(place_name):
|
6 |
url = f"https://nominatim.openstreetmap.org/search?q={place_name}&format=json&limit=1"
|
7 |
+
headers = {
|
8 |
+
'User-Agent': 'YourAppName/1.0 (your_email@example.com)'
|
9 |
+
}
|
10 |
+
response = requests.get(url, headers=headers)
|
11 |
if response.status_code == 200:
|
12 |
results = response.json()
|
13 |
if results:
|