Переход на локальный геокодер.
[pyrungps.git] / pygeocode.py
diff --git a/pygeocode.py b/pygeocode.py
new file mode 100644 (file)
index 0000000..f9fb0fb
--- /dev/null
@@ -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