-1
webmap.py:5: DeprecationWarning: Using Nominatim with the default "geopy/1.22.0" `user_agent` is strongly discouraged, as it violates Nominatim's ToS 
https://operations.osmfoundation.org/policies/nominatim/ and may possibly cause 403 and 429 HTTP errors. 
Please specify a custom `user_agent` with `Nominatim(user_agent="my-application")` or by overriding the default `user_agent`: 
`geopy.geocoders.options.default_user_agent = "my-application"`. 
In geopy 2.0 this will become an exception.
  nom=Nominatim()

The above warning is shown when I run it in my notepad compiled with command prompt, but when I use Jupiter notebook the warning is been shown but continues further and displays the result. Here is my code:

from geopy.geocoders import Nominatim

def map_coordinates(): 
    address = str(input("enter the street name and city seperated by :"))
    nom = Nominatim()
    c = nom.geocode(address)
    return (c.latitude, c.longitude)

z, x = map_coordinates()

I am using the above code to convert the string (address) into co-ordinates. Please help me solve the above warning or please let me know if any other method is available to do the same process.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
sankar
  • 1
  • 1
  • What is the exact problem are you having by trying to follow what the warning says? The same message could be found in the docs, if that makes it any clearer: https://geopy.readthedocs.io/en/1.22.0/#geopy.geocoders.Nominatim . And the correct invocation of Nominatim geocoder can be found here: https://geopy.readthedocs.io/en/1.22.0/#module-geopy.geocoders – KostyaEsmukov Jun 17 '20 at 19:34

1 Answers1

0

my problem is that when i run the above program in command prompt it doesn't provide the location (co-ordinates) of the string.It stops at the warning.

"And the correct invocation of Nominatim geocoder can be found here: geopy.readthedocs.io/en/1.22.0/#module-geopy.geocoders" -@KostyaEsmukov

the above method of invocation also did'nt work for me. It throws the same warning and is not proceeding.

sankar
  • 1
  • 1