Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Tracing latitude and longitude using Python library

Can anyone guide me with the best location tracker ,to trace latitude and longitude using Python library. I am volunteering for not-for-profit ( Wild Life rescue) and eagerly trying to trace the exact location.

My file has 2800 entries to trace the latitude and longitude

My code :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

    lat_long=[]
    import geopandas as gpd
    from geopy.geocoders import ArcGIS
    geolocator = ArcGIS()
    for address in new_wordlist:
        location = geolocator.geocode(address)
        loc={'latitude':location.latitude,'longitude':location.longitude}
        lat_long.append(loc)

Coding is working fine, however getting the below error. And only able to receive 900 entries

Error : HTTPSConnectionPool(host='geocode.arcgis.com', port=443): Max retries exceeded with url: /arcgis/rest/services/World/GeocodeServer/findAddressCandidates?singleLine=John+Oldham+Park+Western+Australia&f=json&maxLocations=1 (Caused by ReadTimeoutError("HTTPSConnectionPool(host='geocode.arcgis.com', port=443): Read timed out. (read timeout=1)"))

Please suggest the best practise to run the code smoothly..

>Solution :

It does not feel that it is coming from your code but rather from a limitation imposed by the website you are querying. I would suggest to put a time.sleep(1) in each of your iteration. If it still does not work. It means that you have a hard cap on the number of queries you can do per day.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading