Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

agrc/geocoding-toolbox

Repository files navigation

This project has been deprecated. See this blog post for more information.

UGRC Geocoding Toolbox

Build Status Coverage Status License: MIT

This custom toolbox created by the UGRC allows ArcGIS users to geocode a table of addresses. The geocoding tool makes use of the UGRC API to perform the geocoding. A complimentary API key will need to be obtained to run the tool.

After the tool has completed, you will find a .csv with the input unique identifier field, the input address information, and the match results as fields.

The table can be joined on the unique record identifier to reconnect the results with the original data. The make xy event layer tool can be used to create points from the x, y values to spatially view the locations in a map.

ArcGIS Support

This tool uses the python requests package that was bundled into ArcGIS Pro at version 1.3. Therefore, this tool is supported by ArcGIS Pro 1.3 or greater.

You can install requests into your ArcGIS Pro conda environment if you cannot upgrade to version 1.3 or greater.

This toolbox can be imported via arcpy just like any other custom toolbox:

arcpy.ImportToolbox(r'<path to folder>\AGRC Geocode Tools.pyt')
arcpy.agrcgeocoding.GeocodeTable('AGRC-99999999999999', r'C:\temp\tests\normal.csv', 'id', 'street', 'zone', r'C:\temp')

Installation

  1. Sign up for an AGRC Web API account and create a new "Server" API key using your external ip address.
  2. Download the ArcGIS Pro Geocoding Tool for python 3 or the less recommended ArcGIS Desktop Geocoding Tool for python 2. Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support.
  3. Unzip the contents of AGRC Geocode Tools.zip to a directory on your computer and open the associated python toolbox in ArcGIS Pro/Desktop.

Development

Releasing

There is a cut_release.py CLI to bump and package releases.

  1. Install dependencies: pip install -e ".[release]"
  2. Cut a release with the CLI python cut_release.py minor
    • To see the full options of the CLI use python cut_release.py --help
  3. Push the release commit to GitHub
    • python cut_release.py publish

Testing

  1. install a local editable module
    • pip install -e ".[tests]"
    • pip install -e . to install without the testing dependencies
  2. run the tests with code coverage. (viewable in vscode with coverage gutters)
    • pytest
    • pwt to run the tests continually in watch mode