Skip to main content

Geocoding Library using ESRI, Bing Maps, and MapQuest geocoders

Project description

http://auto2.cdn.azavea.com/files/8813/6804/5771/70x80xomgeo-logo-color-70px.png.pagespeed.ic.R2Hq0Yficw.png

OMGeo - Python Edition

python-omgeo is a geocoding abstraction layer written in python. Currently supported geocoders:

Installation:

sudo pip install python-omgeo

Documentation

Docs are available in HTML or PDF format.

Usage Example

Make a new geocoder and geocode and address:

>>> from omgeo import Geocoder
>>> g = Geocoder()
>>> result = g.geocode('340 12th St, Philadelphia PA')

Take a look at the result:

>>> result
{'candidates': [
  <340 S 12th St, Philadelphia, PA, 19107 (-75.161461, 39.94532) EsriWGS>,
  <340 N 12th St, Philadelphia, PA, 19107 (-75.158434, 39.958728) EsriWGS>
 ],
 'upstream_response_info': [<EsriWGS 1054ms>]}

Take a closer look at the information in our address Candidate objects:

>>> [c.__dict__ for c in result["candidates"]]
    [{'geoservice': 'EsriWGS',
      'locator': u'USA.AddressPoint',
      'locator_type': u'PointAddress',
      'match_addr': u'340 S 12th St, Philadelphia, PA, 19107',
      'score': 90.87,
      'wkid': 4326,
      'x': -75.161461,
      'y': 39.94532},
     {'geoservice': 'EsriWGS',
      'locator': 'interpolation',
      'locator_type': u'StreetAddress',
      'match_addr': u'340 N 12th St, Philadelphia, PA, 19107',
      'score': 90.87,
      'wkid': 4326,
      'x': -75.158434,
      'y': 39.958728}]

Testing

There is a shell script in the root of the repository called test.dummy.sh. Copy it using cp test.dummy.sh test.sh. Edit test.sh to include the API keys that you obtained from the given geocoding service providers. Then, run the tests using ./test.sh.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-omgeo-1.6.0.tar.gz (34.1 kB view details)

Uploaded Source

File details

Details for the file python-omgeo-1.6.0.tar.gz.

File metadata

File hashes

Hashes for python-omgeo-1.6.0.tar.gz
Algorithm Hash digest
SHA256 63e004de91761c307eb39f8f269a4127324eaed3d1eb0f942ae4ee9c07dd32cb
MD5 7739a01bb4b6ab5fb866519bbf450878
BLAKE2b-256 f2d33c2d7ba5b6788220ae42451754ca6aca9688fe9b25d1228681d6b857137f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page