How to Find list of latitude and longitude using pincode as input

给你一囗甜甜゛ 提交于 2019-12-20 07:43:37

问题


is there any way we can we find list of latitude and longitude using zip/pincode?

Input: 560103
Output : 
12.123456, 72.123456
12.123654, 72.366666
....   
....
12.123456, 72.123456

on google maps, list of lat-long polygon display would be like below map..

Note: Output is just for references, its not correct.


回答1:


Checkout Google Api

Check this out

http://maps.googleapis.com/maps/api/geocode/json?address=110029&sensor=true

This will give you the approx location of pincode 110029

All you have to do is parse the json end extract the coordinates




回答2:


u have to install pyzipcode from https://pypi.python.org/pypi/pyzipcode Later try this code

from pyzipcode import ZipCodeDatabase
zcdb = ZipCodeDatabase()
zipcode = zcdb[54115]
print zipcode.zip
print zipcode.city
print zipcode.state
print zipcode.longitude
print zipcode.latitude
print zipcode.timezone


来源:https://stackoverflow.com/questions/46336328/how-to-find-list-of-latitude-and-longitude-using-pincode-as-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!