X-Git-Url: https://git.rvb.name/pyrungps.git/blobdiff_plain/1690b8b7c8ccfdf60be2b33b314e6c26bdef86e6..94f62add438cdf546fdae207ede72c05daf66c00:/pyrungps/pygeocode.py diff --git a/pyrungps/pygeocode.py b/pyrungps/pygeocode.py new file mode 100644 index 0000000..d048622 --- /dev/null +++ b/pyrungps/pygeocode.py @@ -0,0 +1,21 @@ +# coding=UTF-8 +""" +nominatim.openstreetmap.org API +""" + +import urllib3 + +def GetDescr(lat,lon): + + reqstr = "http://maps.rvb.name/geocode.php?lat=%s&lon=%s" %(lat,lon) + headers = { 'User-Agent' : 'PyRunGPS/1.0', 'Referer' : 'https://maps.rvb.name' } + http_pool = urllib3.connection_from_url(reqstr, headers=headers) + req = http_pool.urlopen('GET',reqstr) + return req.data.decode('utf-8','ignore') + +class GeoName: + + def __init__(self, lat, lon): + + self.printable = GetDescr(lat,lon) + \ No newline at end of file