J
J
James_Obry2021-11-27 18:40:05
Bots
James_Obry, 2021-11-27 18:40:05

How to find out the name of the city from the geolocation that is sent to the telegram bot, telebot?

The bottom line is this, I send my geolocation to the bot, and he should find out the name of the city from which I sent the geolocation, how can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2021-11-27
@hint000

https://habr.com/en/post/505500/
https://www.google.com/search?q=reverse+geocoder...
https://github.com/DenisCarriere/geocoder
https://pypi .org/project/geopy/
https://www.geeksforgeeks.org/get-the-city-state-a...

V
Vasily Bannikov, 2021-11-27
@vabka

https://core.telegram.org/bots/api#location
The Location object has a latitude and longitude.
From them, you can determine the city using reverse geocoding.
This service is provided by
Google: https://developers.google.com/maps/documentation/g...
Yandex: https://yandex.com/dev/maps/geocoder/
And sort of like OSM: https://wiki. openstreetmap.org/wiki/Nominatim

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question