Переход на UTF8.
[pyrungps.git] / pygeocode.py
1 # coding=UTF-8
2 """
3 nominatim.openstreetmap.org API
4 """
5
6 import urllib2
7
8 def GetDescr(lat,lon):
9
10     reqstr = "http://maps.rvb.name/geocode.php?lat=%s&lon=%s" %(lat,lon)
11     headers = { 'User-Agent' : 'PyRunGPS/1.0', 'Referer' : 'https://maps.rvb.name' }    
12     req = urllib2.Request(reqstr, None, headers)
13     page = urllib2.urlopen(req).read()
14
15     return page
16
17 class GeoName:
18
19     def __init__(self, lat, lon):
20
21         self.printable = GetDescr(lat,lon)
22