Skip to main content

No project description provided

Project description

Whereabouts

Fast, scalable geocoding for Python using DuckDB. The geocoding algorithms are based on the following papers:

Description

Geocode addresses and reverse geocode coordinates directly from Python in your own environment.

  • No additional database setup required. Uses DuckDB to run all queries
  • No need to send data to an external geocoding API
  • Fast (Geocode 1000s / sec and reverse geocode 200,000s / sec)
  • Robust to typographical errors

Requirements

  • Python 3.8+
  • Poetry (for package management)

Installation

Once Poetry is installed and you are in the project directory:

poetry shell
poetry install

The current process for using Australian data from the GNAF is as follows:

  1. Download the latest version of GNAF core from https://geoscape.com.au/data/g-naf-core/
  2. Update the setup.yml file to point to the location of the GNAF core file
  3. Finally, setup the geocoder. This creates the required reference tables
python setup_geocoder.py

To use address data from another country, the file should have the following columns:

Column name Description
ADDRESS_DETAIL_PID Unique identifier for address
ADDRESS_LABEL The full address
ADDRESS_SITE_NAME Name of the site. This is usually null
LOCALITY_NAME Name of the suburb or locality
POSTCODE Postcode of address
STATE State
LATITUDE Latitude of geocoded address
LONGITUDE Longitude of geocoded address

Note that by default the file should be pipe-separated, i.e., use '|' as the delimitor.

Examples

Geocode a list of addresses

from whereabouts.Matcher import Matcher

matcher = Matcher(db_name='gnaf_au')
matcher.geocode(addresslist, how='standard')

For more accurate geocoding you can use trigram phrases rather than token phrases (note that the trigram option has to have been specified in the setup.yml file as part of the setup)

matcher.geocode(addresslist, how='trigram')

Once a Matcher object is created, the KD-tree for fast geocoding will also be created. A list of latitude, longitude values can then be reverse geocoded as follows

matcher.reverse_geocode(coordinates)

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

whereabouts-0.2.4.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whereabouts-0.2.4-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file whereabouts-0.2.4.tar.gz.

File metadata

  • Download URL: whereabouts-0.2.4.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/23.1.0

File hashes

Hashes for whereabouts-0.2.4.tar.gz
Algorithm Hash digest
SHA256 25a6672584f8d7ef4b8326d5653d8ca7eeb89397b1c7a882da8751893e164040
MD5 f787483785bab5657f6db1aea16b41e6
BLAKE2b-256 9cd899b8b4277543aadaf650b158746c6e86c4bfbb42c979aedb7bdc593ec893

See more details on using hashes here.

File details

Details for the file whereabouts-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: whereabouts-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/23.1.0

File hashes

Hashes for whereabouts-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 306e0395ef4df0043e75412afe7aacecb0705691953b313bff6d41910315699e
MD5 71c8192668586d7c32670372a338e0de
BLAKE2b-256 617d6f920d6366ef9aad1d2ad769a8e390faa435e9cb6020b9a782590045aca3

See more details on using hashes here.

Supported by

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