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

后端 未结 2 1162
灰色年华
灰色年华 2021-01-29 06:59

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
....   
....
         


        
2条回答
  •  天命终不由人
    2021-01-29 07:19

    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
    

提交回复
热议问题