From 06a60a8c3bdb14e4e1ad754110f6304196b7d3e2 Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Fri, 22 May 2020 17:46:14 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20?= =?utf8?q?=D0=BD=D0=B0=20=D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B?= =?utf8?q?=D0=B9=20=D0=B3=D0=B5=D0=BE=D0=BA=D0=BE=D0=B4=D0=B5=D1=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- pygeocode.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 pygeocode.py diff --git a/pygeocode.py b/pygeocode.py new file mode 100644 index 0000000..f9fb0fb --- /dev/null +++ b/pygeocode.py @@ -0,0 +1,22 @@ +# coding=UTF-8 +""" +nominatim.openstreetmap.org API +""" + +import urllib2 + +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' } + req = urllib2.Request(reqstr, None, headers) + page = urllib2.urlopen(req).read() + + return page + +class GeoName: + + def __init__(self, lat, lon): + + self.printable = GetDescr(lat,lon) + \ No newline at end of file -- 2.34.1