コード例 #1
0
ファイル: track_num.py プロジェクト: rohanmourya123/python1
from phonenumbers import carrier

service = phonenumbers.parse(number)
print(carrier.name_for_number(service,"en"))


from opencage.geocoder import OpenCageGeocode

# we required a key:-

key = "ecbe2bd8865f4b389e409b887a07a874"

geocoder=OpenCageGeocode(key)

query1 = str(location_of_number)
result = geocoder.geocode(query1)
# print(result)

lat = result[0]['geometry']['lat']
lng = result[0]['geometry']['lng']

print(lat,lng)

myMap = folium.Map(location=[lat,lng],zoom_stat = 10)
folium.Marker([lat,lng],popup=location_of_number).add_to((myMap))

# save  map to html file

myMap.save("mylocation.html")

コード例 #2
0
import phonenumbers
from test import number
import folium

from phonenumbers import geocoder
Key = "0acbae22f58c4942a959a7e30a8c4192"
ch_num = phonenumbers.parse(number, "CH")
youLoc = geocoder.description_for_number(ch_num, "en")
print(youLoc)

from phonenumbers import carrier
service_num = phonenumbers.parse(number, "RO")
print(carrier.name_for_number(service_num, "en"))

from opencage.geocoder import OpenCageGeocode
geocoder = OpenCageGeocode(Key)
Query = str(youLoc)
results = geocoder.geocode(Query)
print(results)

lat = results[0]["geometry"]["lat"]
lng = results[0]["geometry"]["lng"]
print(lat, lng)

myMap = folium.Map(location=[lat, lng], zoom_start=9)
folium.Marker([lat, lng], popup=youLoc).add_to(myMap)
myMap.save("myLocation.html")
コード例 #3
0
from opencage.geocoder import OpenCageGeocode
Key = "825fa16307ea45209b19c40f99abfab7"

samNumber = phonenumbers.parse(number)

yourLocation = geocoder.description_for_number(samNumber, "en")
print(yourLocation)

service_provider = phonenumbers.parse(number)
print(carrier.name_for_number(service_provider, "en"))

geocoder = OpenCageGeocode(Key)

query = str(yourLocation)

results = geocoder.geocode(query)

#print(results)

lat = results[0]['geometry']['lat']

lng = results[0]['geometry']['lng']

print(lat, lng)

myMap = folium.Map(lacation=[lat, lng], zoom_start=9)

folium.Marker([lat, lng], popup=yourLocation).add_to(myMap)

myMap.save("myLocation.html")