In [14]:
import urllib.request
import json

In [12]:
x = 30.+(27/60.)
print (str(x))
y = 70.+(40/60.)
print (str(y))


30.45
70.66666666666667

In [16]:
lati = input("Enter the latitude:")
lngi = input("Enter the longitude:")

# url_params completes the base url with the given latitude and longitude values
ELEVATION_BASE_URL = 'http://maps.googleapis.com/maps/api/elevation/json?'
URL_PARAMS = "locations=%s,%s&sensor=%s" % (lati, lngi, "false")
url=ELEVATION_BASE_URL + URL_PARAMS
with urllib.request.urlopen(url) as f:
    response = json.loads(f.read().decode())    
    status = response["status"]
    result = response["results"][0]
print(float(result["elevation"]))
print(float(result["location"]["lat"]))
print(float(result["location"]["lng"]))


Enter the latitude:-33.425278
Enter the longitude:-70.633333
837.7554321289062
-33.425278
-70.633333

In [17]:


In [24]:


In [25]:


In [26]:


In [28]:



  File "<ipython-input-28-e79d4685395e>", line 1
    kml <placemark>
                   ^
SyntaxError: invalid syntax

In [ ]: