DenisCarriere / geocoder

:earth_asia: Python Geocoder
http://geocoder.readthedocs.org
MIT License
1.62k stars 286 forks source link

GPS location #445

Open vijaygrg27 opened 3 years ago

vijaygrg27 commented 3 years ago

How to use geocoder to track live location? I am creating an application to track my current location.

I have used the below code but it's not tracking my location .

import geocoder

g = geocoder.ip("me") props = g.geojson["features"][0]["properties"] lat = props["lat"] lon = props["lng"] print(lat, lon)

Please help

remi-sap commented 2 years ago

You example works for me. This geocoding service uses the incoming IP address which doesn't change if internet access is provided by a mobile phone or a 4G hotspot.

IP address is not an accurate signal to use for location tracking. Better try your luck with a wifi based positioning system or just use a device with a gps.