Skip to content

Commit

Permalink
Add geocode function
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwill committed Mar 12, 2012
1 parent 74fd91f commit e95ed18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -56,6 +56,9 @@ set.
>>> mapq.batch('94103', '1 Infinity Loop Cupertino, CA')
[{'multiple': 'locations'}, ...]

>>> mapq.geocode('155 9th St San Francisco, CA')
{'single': {'geocode': 'result'}}

>>> mapq.reverse(37.775002, -122.418297)
{'looks': {'like': '155 9th St'}}

Expand Down
2 changes: 1 addition & 1 deletion mapq/__init__.py
@@ -1,2 +1,2 @@
from .core import address, batch, latlng, reverse
from .core import address, batch, geocode, latlng, reverse
from .geo import Geo
5 changes: 5 additions & 0 deletions mapq/core.py
Expand Up @@ -15,6 +15,11 @@ def batch(*locations):
return Geo().batch(*locations)


def geocode(address):
"""Return first the geocode result for a given address."""
return Geo().address(address)[0]


def latlng(address):
"""Get the latitude and longitude coordinates for an address."""
return Geo().latlng(address)
Expand Down

0 comments on commit e95ed18

Please sign in to comment.