From fea9a422071698b60f5dc98ebfecb8252a252011 Mon Sep 17 00:00:00 2001 From: Jonas Geduldig Date: Tue, 19 Feb 2013 11:42:35 -0500 Subject: [PATCH] Geocoder uses viewport insteadd of bounds Geocoder uses viewport insteadd of bounds --- CHANGES.txt | 4 +++- setup.py | 2 +- twittergeo/Geocoder.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b398f8e..0d73a03 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,4 +8,6 @@ v0.1.2, 20 Jan 2013 -- Improved exception handling for less fragile connections v1.0.0, 30 Jan 2013 -- Uploaded to github. -v1.1.0, 12 Feb 2013 -- Replaced TwitterAPI with puttytat for Twitter requests. \ No newline at end of file +v1.1.0, 12 Feb 2013 -- Replaced TwitterAPI with puttytat for Twitter requests. + +v1.1.1, 19 Feb 2013 -- Geocoder uses viewport instead of bounds. \ No newline at end of file diff --git a/setup.py b/setup.py index 10d3a45..9bc6d94 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='TwitterGeo', - version='1.1.0', + version='1.1.1', author='Jonas Geduldig', author_email='boxnumber03@gmail.com', packages=['twittergeo'], diff --git a/twittergeo/Geocoder.py b/twittergeo/Geocoder.py index 7b84556..98c34fc 100755 --- a/twittergeo/Geocoder.py +++ b/twittergeo/Geocoder.py @@ -254,8 +254,8 @@ def get_region_box(self, place): results = self.geocode(place) geometry = results.raw[0]['geometry'] latC, lngC = geometry['location']['lat'], geometry['location']['lng'] - latSW, lngSW = geometry['bounds']['southwest']['lat'], geometry['bounds']['southwest']['lng'] - latNE, lngNE = geometry['bounds']['northeast']['lat'], geometry['bounds']['northeast']['lng'] + latSW, lngSW = geometry['viewport']['southwest']['lat'], geometry['viewport']['southwest']['lng'] + latNE, lngNE = geometry['viewport']['northeast']['lat'], geometry['viewport']['northeast']['lng'] return latC, lngC, latSW, lngSW, latNE, lngNE def get_region_circle(self, place):