Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Commit

Permalink
added 243 files; modified README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bengtsson committed Aug 15, 2009
1 parent 6477aea commit 012c43e
Show file tree
Hide file tree
Showing 244 changed files with 51,297 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.venv
*.pickle
*~
*.pyc
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ to access GeoNames to get the place name and country name from a
lat/long coordinate.

[Read my blog entry about this](http://www.peterbe.com/plog/google-reverse-geocoding-vs.-geonames/)
on [Peterbe.com](http://www.peterbe.com/)
on [Peterbe.com](http://www.peterbe.com/)

To test it you need to install geopy, the reverse-geocode branch:

svn checkout \
http://geopy.googlecode.com/svn/branches/reverse-geocode \
geopy


59 changes: 59 additions & 0 deletions analyze-results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sys, os
import cPickle
pickle_file = sys.argv[1]
assert os.path.isfile(pickle_file)

results = cPickle.load(open(pickle_file,'rb'))

from pprint import pprint
all_apps = set()
from collections import defaultdict
coords = defaultdict(list)
app_totals = defaultdict(float)
app_totals_count = defaultdict(int)
app_failures = defaultdict(int)
for key, result in results.items():
app, coord = key.split('__')
all_apps.add(app)
app_totals[app] += result[1]
app_totals_count[app] += 1
if result[0] == "FAILED":
app_failures[app] += 1
else:
app_failures[app] += 0
this_result = (result[0], result[1], '\n'.join(result[2]))
if coord in coords:
coords[coord][app] = this_result
else:
coords[coord] = {app:this_result}

all_apps = list(all_apps)
all_apps.sort()
coords = dict(coords)
print "\t", "App".ljust(15)
print "_"*70

for coord, results in coords.items():
print coord.ljust(39), repr(results[all_apps[0]][2])
for app in all_apps:
print "\t",app.ljust(15),
data = results[app]
print str(data[1])[:7].ljust(15),
if len(data[0]) > 50:
print repr(data[0][:50])+'...'
else:
print repr(data[0][:50])
print




print
print "FAILURES:"
for app, count in dict(app_failures).items():
print app.ljust(20), count

print
print "TOTALS:"
for app, total in dict(app_totals).items():
print app.ljust(20), str(total).ljust(20), total/app_totals_count[app], "seconds/request"
23 changes: 23 additions & 0 deletions reverse-geocode-branch/.svn/all-wcprops
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
K 25
svn:wc:ra_dav:version-url
V 41
/svn/!svn/ver/84/branches/reverse-geocode
END
LICENSE
K 25
svn:wc:ra_dav:version-url
V 49
/svn/!svn/ver/76/branches/reverse-geocode/LICENSE
END
setup.py
K 25
svn:wc:ra_dav:version-url
V 50
/svn/!svn/ver/76/branches/reverse-geocode/setup.py
END
setup.cfg
K 25
svn:wc:ra_dav:version-url
V 51
/svn/!svn/ver/76/branches/reverse-geocode/setup.cfg
END
145 changes: 145 additions & 0 deletions reverse-geocode-branch/.svn/entries
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
9

dir
84
http://geopy.googlecode.com/svn/branches/reverse-geocode
http://geopy.googlecode.com/svn



2009-05-22T04:23:31.321467Z
84
david.ziegler


svn:special svn:externals svn:needs-lock











535ce8a4-231d-0410-ac7f-15f3cd728b52

build
dir

tests
dir

LICENSE
file




2009-08-14T22:47:33.000000Z
712a488b2729db0f55d992060875f18e
2009-03-06T20:39:28.083675Z
76
david.ziegler





















1065

dist
dir

geopy
dir

setup.py
file




2009-08-14T22:47:33.000000Z
d4071bed0279fcf0e75f4b90a1068dbd
2009-03-06T20:39:28.083675Z
76
david.ziegler





















949

geopy.egg-info
dir

setup.cfg
file




2009-08-14T22:47:33.000000Z
ced32e2c28d3b229c8aad7c585425ccf
2009-03-06T20:39:28.083675Z
76
david.ziegler





















51

1 change: 1 addition & 0 deletions reverse-geocode-branch/.svn/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
19 changes: 19 additions & 0 deletions reverse-geocode-branch/.svn/text-base/LICENSE.svn-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2006 Brian Beck

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions reverse-geocode-branch/.svn/text-base/setup.cfg.svn-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[egg_info]
tag_build = dev
tag_svn_revision = true
22 changes: 22 additions & 0 deletions reverse-geocode-branch/.svn/text-base/setup.py.svn-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from setuptools import setup, find_packages

setup(name='geopy',
version='0.93',
description='Python Geocoding Toolbox',
author='Brian Beck',
author_email='exogen@gmail.com',
url='http://exogen.case.edu/projects/geopy/',
download_url='http://geopy.googlecode.com/svn/trunk/',
packages=find_packages(),
license='MIT',
keywords='geocode geocoding gis geographical maps earth distance',
classifiers=["Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Software Development :: Libraries :: Python Modules"
],
)
19 changes: 19 additions & 0 deletions reverse-geocode-branch/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2006 Brian Beck

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 012c43e

Please sign in to comment.